Best code examples for Hibernate ORM TransactionCoordinatorImpl class (org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl)

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

Hibernate ORM TransactionCoordinatorImpl examples from Open Source projects
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() );

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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
	public TransactionCoordinator getTransactionCoordinator() { 
		return transactionCoordinator; 
	public TransactionEnvironment getTransactionEnvironment() { 
		return factory.getTransactionEnvironment(); 
Full Snippet Info
See Code Examples for Hibernate ORM TransactionCoordinatorImpl Methods: