boolean explicitTransactions = false ;
// Make store.
{
SDBConnection sConn1 = SDBConnectionFactory.create(conn) ;
Store store1 = StoreFactory.create(sConn1, store.getLayoutType(), store.getDatabaseType()) ;
if ( explicitTransactions )
store1.getConnection().getTransactionHandler().begin() ;
Graph graph1 = SDBFactory.connectDefaultGraph(store1) ;
graph1.add(t1) ;
assertTrue(graph1.contains(t1)) ;
if ( explicitTransactions )
{
store1.getConnection().getTransactionHandler().commit() ;
assertTrue(graph1.contains(t1)) ;
}
//store1.close() ;
}
// Mythically return conn to the pool.
// Get from pool
// i.e. same connection. Make a store around it
{
SDBConnection sConn2 = SDBConnectionFactory.create(conn) ;
Store store2 = StoreFactory.create(sConn2, store.getLayoutType(), store.getDatabaseType()) ;
if ( explicitTransactions )
store2.getConnection().getTransactionHandler().begin() ;
Graph graph2 = SDBFactory.connectDefaultGraph(store2) ;
assertTrue(graph2.contains(t1)) ;
graph2.add(t2) ;
assertTrue(graph2.contains(t2)) ;
if ( explicitTransactions )
store2.getConnection().getTransactionHandler().commit() ;
//store2.close() ;
}
System.exit(0) ;
}