Exemple #1
0
            public Env(string home)
            {
                int ret = db_env_create(out envptr, 0);

                CheckError(ret);

                funcs1 = (envstruct1)Marshal.PtrToStructure((IntPtr)((int)envptr + 276), typeof(envstruct1));
                funcs2 = (envstruct2)Marshal.PtrToStructure((IntPtr)((int)envptr + 712), typeof(envstruct2));

                funcs1.set_flags(envptr, DB_LOG_INMEMORY, 1);

                ret = funcs1.open(envptr, home, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE, 0);                  // | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN
                if (ret != 0)
                {
                    funcs1.close(envptr, 0);
                }
                CheckError(ret);
            }
Exemple #2
0
			public Env(string home) {
				int ret = db_env_create(out envptr, 0);
				CheckError(ret);
				
				funcs1 = (envstruct1)Marshal.PtrToStructure((IntPtr)((int)envptr+276), typeof(envstruct1));
				funcs2 = (envstruct2)Marshal.PtrToStructure((IntPtr)((int)envptr+712), typeof(envstruct2));
				
				funcs1.set_flags(envptr, DB_LOG_INMEMORY, 1);
				
				ret = funcs1.open(envptr, home, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE , 0); // | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN
				if (ret != 0)
					funcs1.close(envptr, 0);
				CheckError(ret);
			}