2017-08-10 191 views
0

我需要將一些文檔從一個容器複製到XML DB 2.5.16中的另一個容器。將內容從一個容器複製到Berkeley的另一個容器XMLDb

下面是打開這些集裝箱

public static void main(String[] args) throws DatabaseException { 

    EnvironmentConfig config_1 = getEnvConfig(); 
    EnvironmentConfig config_2 = getEnvConfig(); 
    Environment dbEnv_1 = new Environment(<dbEnvPath1>, config); 
    Environment dbEnv_2 = new Environment(<dbEnvPath2>, config_new); 
    XmlManager mgr_1 = new XmlManager(dbEnv_1 ,getManagerConfig()); 
    XmlContainer cont_1 = mgr_1.openContainer(<containerName_1>, getContainerConfig()); 
    XmlManager mgr_2 = new XmlManager(dbEnv_2,getManagerConfig()); 
    XmlContainer cont_2 = mgr_2_new.openContainer(<containerName_2>, getContainerConfig()); 
} 
private static EnvironmentConfig getEnvConfig() throws 
     DatabaseException{ 
    EnvironmentConfig config = new EnvironmentConfig(); 
    config.setErrorStream(System.err); 
    config.setAllowCreate(true); 
    config.setRunRecovery(true); 
    config.setTransactional(true); 
    config.setInitializeLocking(true); 
    config.setInitializeLogging(true); 
    config.setInitializeCache(true); 
    config.setLogAutoRemove(true); 
    config.setCacheSize(134217728); 
    config.setMaxLocks(80000); 
    config.setMaxLockers(4000000); 
    config.setMaxLockObjects(80000); 
    config.setMaxMutexes(86068); 
    config.setMaxMutexes(70000); 
    return config; 
} 
private static XmlManagerConfig getManagerConfig(){ 
    XmlManagerConfig mconfig = new XmlManagerConfig(); 
    mconfig.setAllowExternalAccess(true); 
    return mconfig; 
} 
private static XmlContainerConfig getContainerConfig(){ 
    XmlContainerConfig cconfig = new XmlContainerConfig(); 
    cconfig.setAllowValidation(false); 
    cconfig.setTransactional(true); 
    return cconfig; 
} 

在運行這段代碼中,我得到了以下錯誤的片段

PANIC: fatal region error detected; run recovery com.sleepycat.dbxml.XmlException: Error: DB_RUNRECOVERY: Fatal error, run database recovery, errcode = DATABASE_ERROR at com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_openContainerInternal__SWIG_0(Native Method)
at com.sleepycat.dbxml.XmlManager.openContainerInternal(XmlManager.java:621) at com.sleepycat.dbxml.XmlManager.openContainer(XmlManager.java:197)

回答

相關問題