@Test() public void noTransactionSharing() { final ObjectContainer session1 = toTest.acquire(); final ObjectContainer session2 = toTest.acquire(); session1.store(new AStoredObject()); final int count1 = session1.query(AStoredObject.class).size(); session2.rollback(); final int count2 = session1.query(AStoredObject.class).size(); assertEquals(2,count1); assertEquals(2,count2); }
public ObjectContainer acquire() { synchronized (sync){ SessionClientPair containerPair = acquirePooledContainer(); leasedClients.put(containerPair.sessionContainer,containerPair.clientContainer); return containerPair.sessionContainer; } }
ConnectionPool { public ObjectContainer acquire() { synchronized (sync){ SessionClientPair containerPair = acquirePooledContainer(); leasedClients.put(containerPair.sessionContainer,containerPair.clientContainer); return containerPair.sessionContainer; } } }
ConnectionPool { public ObjectContainer acquire() { synchronized (sync){ SessionClientPair containerPair = acquirePooledContainer(); leasedClients.put(containerPair.sessionContainer,containerPair.clientContainer); return containerPair.sessionContainer; } } ConnectionPool(ClientConnectionFactory connectionFactory); }
ConnectionPool { public ObjectContainer acquire() { synchronized (sync){ SessionClientPair containerPair = acquirePooledContainer(); leasedClients.put(containerPair.sessionContainer,containerPair.clientContainer); return containerPair.sessionContainer; } } ConnectionPool(ClientConnectionFactory connectionFactory); ObjectContainer acquire(); void release(ObjectContainer session); void closeAndRelease(ObjectContainer session); }
ConnectionPool { public ObjectContainer acquire() { synchronized (sync){ SessionClientPair containerPair = acquirePooledContainer(); leasedClients.put(containerPair.sessionContainer,containerPair.clientContainer); return containerPair.sessionContainer; } } ConnectionPool(ClientConnectionFactory connectionFactory); ObjectContainer acquire(); void release(ObjectContainer session); void closeAndRelease(ObjectContainer session);  }