All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.schedulerx.worker.master.persistence.H2FilePersistence Maven / Gradle / Ivy

There is a newer version: 1.12.2
Show newest version
package com.alibaba.schedulerx.worker.master.persistence;

import com.alibaba.schedulerx.worker.util.WorkerIdGenerator;

/**
 *
 * @author xiaomeng.hxm
 */
public class H2FilePersistence extends H2Persistence {

    private static H2FilePersistence instance = new H2FilePersistence();
    private H2FilePersistence() {
        this.h2CP = new H2ConnectionPool("jdbc:h2:file:retry:~/.h2/schedulerx2/" + WorkerIdGenerator.get() + ";"
            + "LOG=1;CACHE_SIZE=10240;"
            + "AUTO_SERVER=TRUE;AUTO_RECONNECT=TRUE;"
            + "MODE=MySQL;DB_CLOSE_ON_EXIT=FALSE;"
            + "DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false");
        this.taskDao = new TaskDao(h2CP);
    }
    public static H2FilePersistence getInstance() {
        return instance;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy