Search in sources :

Example 1 with OldPreparedTransactionBinding

use of org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransactionBinding in project qpid-broker-j by apache.

the class UpgradeFrom5To6Test method populateOldXidEntries.

private void populateOldXidEntries(Environment environment) {
    final DatabaseEntry value = new DatabaseEntry();
    OldRecordImpl[] enqueues = { new OldRecordImpl("TEST1", 1) };
    OldRecordImpl[] dequeues = { new OldRecordImpl("TEST2", 2) };
    OldPreparedTransaction oldPreparedTransaction = new OldPreparedTransaction(enqueues, dequeues);
    OldPreparedTransactionBinding oldPreparedTransactionBinding = new OldPreparedTransactionBinding();
    oldPreparedTransactionBinding.objectToEntry(oldPreparedTransaction, value);
    final DatabaseEntry key = getXidKey();
    new DatabaseTemplate(environment, OLD_XID_DB_NAME, null).run(new DatabaseRunnable() {

        @Override
        public void run(Database xidDatabase, Database nullDatabase, Transaction transaction) {
            xidDatabase.put(null, key, value);
        }
    });
}
Also used : OldPreparedTransactionBinding(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransactionBinding) NewPreparedTransaction(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.NewPreparedTransaction) OldPreparedTransaction(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransaction) Transaction(com.sleepycat.je.Transaction) Database(com.sleepycat.je.Database) OldRecordImpl(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldRecordImpl) DatabaseEntry(com.sleepycat.je.DatabaseEntry) OldPreparedTransaction(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransaction)

Aggregations

Database (com.sleepycat.je.Database)1 DatabaseEntry (com.sleepycat.je.DatabaseEntry)1 Transaction (com.sleepycat.je.Transaction)1 NewPreparedTransaction (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.NewPreparedTransaction)1 OldPreparedTransaction (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransaction)1 OldPreparedTransactionBinding (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransactionBinding)1 OldRecordImpl (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldRecordImpl)1