<commit_before>package com.validation.manager.core;

import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.api.FlywayException;
import com.googlecode.flyway.core.api.MigrationInfo;
import com.googlecode.flyway.core.api.MigrationState;
import com.validation.manager.core.db.VmId;
import com.validation.manager.core.db.controller.VmIdJpaController;
import com.validation.manager.core.server.core.VMIdServer;
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.ESqlStatementType;
import gudusoft.gsqlparser.TGSqlParser;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
import static java.lang.Class.forName;
import static java.lang.Integer.parseInt;
import static java.lang.Long.valueOf;
import static java.lang.System.getProperty;
import static java.lang.Thread.sleep;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.ResourceBundle;
import static java.util.ResourceBundle.getBundle;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import static java.util.logging.Logger.getLogger;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import static javax.persistence.Persistence.createEntityManagerFactory;
import javax.persistence.Query;
import javax.persistence.TableGenerator;
import javax.persistence.metamodel.EmbeddableType;
import javax.persistence.metamodel.EntityType;
import javax.sql.DataSource;
import org.h2.jdbcx.JdbcDataSource;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class DataBaseManager {

    private static EntityManagerFactory emf;
    private static Map<String, Object> properties;
    //Default. Can be overwritten using setPersistenceUnitName(String aPU)
    private static String PU = "VMPU";
    private static EntityManager em;
    private static boolean dbError = false;
    private static final Logger LOG
            = getLogger(DataBaseManager.class.getSimpleName());
    private static DBState state = DBState.START_UP;
    private static final ResourceBundle settings
            = getBundle("com.validation.manager.resources.settings");
    private static boolean locked = false;
    private static boolean usingContext;
    private static boolean demo;
    private static Long demoResetPeriod;
    private static DataBaseManager instance;
    private static boolean versioning_enabled = true;

    /**
     * @return the versioning enabled<commit_msg>Disable versioning as default. Still more testing needs to occur.<commit_after>package com.validation.manager.core;

import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.api.FlywayException;
import com.googlecode.flyway.core.api.MigrationInfo;
import com.googlecode.flyway.core.api.MigrationState;
import com.validation.manager.core.db.VmId;
import com.validation.manager.core.db.controller.VmIdJpaController;
import com.validation.manager.core.server.core.VMIdServer;
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.ESqlStatementType;
import gudusoft.gsqlparser.TGSqlParser;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
import static java.lang.Class.forName;
import static java.lang.Integer.parseInt;
import static java.lang.Long.valueOf;
import static java.lang.System.getProperty;
import static java.lang.Thread.sleep;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.ResourceBundle;
import static java.util.ResourceBundle.getBundle;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import static java.util.logging.Logger.getLogger;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import static javax.persistence.Persistence.createEntityManagerFactory;
import javax.persistence.Query;
import javax.persistence.TableGenerator;
import javax.persistence.metamodel.EmbeddableType;
import javax.persistence.metamodel.EntityType;
import javax.sql.DataSource;
import org.h2.jdbcx.JdbcDataSource;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class DataBaseManager {

    private static EntityManagerFactory emf;
    private static Map<String, Object> properties;
    //Default. Can be overwritten using setPersistenceUnitName(String aPU)
    private static String PU = "VMPU";
    private static EntityManager em;
    private static boolean dbError = false;
    private static final Logger LOG
            = getLogger(DataBaseManager.class.getSimpleName());
    private static DBState state = DBState.START_UP;
    private static final ResourceBundle settings
            = getBundle("com.validation.manager.resources.settings");
    private static boolean locked = false;
    private static boolean usingContext;
    private static boolean demo;
    private static Long demoResetPeriod;
    private static DataBaseManager instance;
    private static boolean versioning_enabled = false;

    /**
     * @return the versioning enabled
{'fraction_non_alphanumeric': 0.08917819365337673, 'fraction_numerical': 0.00032546786004882016, 'mean_word_length': 5.375518672199171, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2016270', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1739, 'n_words': 410}