OwlapiDriver implements Closeable, ConnectionListener { Connection acquireConnection() throws OntoDriverException { assert open; final OwlapiAdapter adapter = new OwlapiAdapter(connectorFactory.getConnector(configuration)); final OwlapiConnection c = new OwlapiConnection(adapter); c.setTypes(new OwlapiTypes(adapter, c::ensureOpen, c::commitIfAuto)); c.setProperties(new OwlapiProperties(adapter, c::ensureOpen, c::commitIfAuto)); c.setLists(new OwlapiLists(adapter, c::ensureOpen, c::commitIfAuto)); openConnections.add(c); c.setListener(this); return c; } OwlapiDriver(OntologyStorageProperties storageProperties, Map<String, String> properties); @Override synchronized void close(); @Override boolean isOpen(); @Override void connectionClosed(Connection connection);  }
@Test public void createsNewConnectionsForAllRequests() throws Exception { final Connection cOne = driver.acquireConnection(); assertNotNull(cOne); final Connection cTwo = driver.acquireConnection(); assertNotNull(cTwo); assertNotSame(cOne, cTwo); }