Hibernate ORM TransactionCoordinatorImpl - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM TransactionCoordinatorImpl class.

This code example shows how to use the following methods:addObserver, getJdbcCoordinator, getTransaction
	public void testNonBatchingUsage() throws Exception {
		final TransactionContext transactionContext = new TransactionContextImpl(
				new TransactionEnvironmentImpl( serviceRegistry )
		); 
 
		TransactionCoordinatorImpl transactionCoordinator = new TransactionCoordinatorImpl( null, transactionContext );
		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() );
		statement.close();

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	private TransactionCoordinator transactionCoordinator; 
	private PersistenceContext temporaryPersistenceContext = new StatefulPersistenceContext( this ); 
 
	StatelessSessionImpl(Connection connection, String tenantIdentifier, SessionFactoryImpl factory) { 
		super( factory, tenantIdentifier ); 
		this.transactionCoordinator = new TransactionCoordinatorImpl( connection, this ); 
	} 
 
	// TransactionContext ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 
	@Override 
	public TransactionCoordinator getTransactionCoordinator() { 
		return transactionCoordinator; 
	} 
 
	@Override 
	public TransactionEnvironment getTransactionEnvironment() { 
		return factory.getTransactionEnvironment(); 
	} 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Hibernate ORM TransactionCoordinatorImpl Methods: