Best code examples for Hibernate ORM LogicalConnectionImplementor class (org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM LogicalConnectionImplementor class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM LogicalConnectionImplementor examples from Open Source projects
This code example shows how to use the following methods: close, getResourceRegistry, getShareableConnectionProxy, isPhysicallyConnected
		JournalingTransactionObserver observer = new JournalingTransactionObserver();
		transactionCoordinator.addObserver( observer );
		final JdbcCoordinator jdbcCoordinator = transactionCoordinator.getJdbcCoordinator();
		LogicalConnectionImplementor logicalConnection = jdbcCoordinator.getLogicalConnection();
		Connection connection = logicalConnection.getShareableConnectionProxy();
		// set up some tables to use 
		Statement statement = connection.createStatement();
		statement.execute( "drop table SANDBOX_JDBC_TST if exists" );
		statement.execute( "create table SANDBOX_JDBC_TST ( ID integer, NAME varchar(100) )" );
		assertTrue( logicalConnection.getResourceRegistry().hasRegisteredResources() );
		assertTrue( logicalConnection.isPhysicallyConnected() );
		assertFalse( logicalConnection.getResourceRegistry().hasRegisteredResources() );
		assertTrue( logicalConnection.isPhysicallyConnected() ); // after_transaction specified
		// ok, now we can get down to it... 
		TransactionImplementor txn = transactionCoordinator.getTransaction();  // same as Session#getTransaction