Hibernate ORM Transaction - 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 Transaction class.

This code example shows how to use the following methods: isActive
 
	@Override 
	public boolean isTransactionInProgress( 
			JDBCContext jdbcContext, Context transactionContext, Transaction transaction) {
 
		return (transaction != null && transaction.isActive()) ||
				TransactionSynchronizationManager.isActualTransactionActive(); 
	} 
 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: commit
			cars[i] = new LegacyCar();
			cars[i].setId( "" + i );
			cars[i].setModel( "model" + i );
			fullTextSession.persist( cars[i] );
		} 
		transaction.commit();
	} 
 
	@Override 
	protected Class<?>[] getAnnotatedClasses() {
		return new Class[] { LegacyCarPlant.class, LegacyCar.class, LegacyTire.class };
	} 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: commit, isActive
	@Override 
	@After 
	public void tearDown() throws Exception {
		try { 
			Transaction tx = fts.getTransaction();
			if ( !tx.isActive() ) {
				tx = fts.beginTransaction();
			} 
			assertEquals( 1000, fts.createQuery( "delete from " + Clock.class.getName() ).executeUpdate() );
			fts.purgeAll( Clock.class );
			tx.commit();
			fts.close();
		} 
		finally { 
			super.tearDown(); 
		} 
	} 
 
	@Test
	public void testTimeout() { 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: commit
		// verify the deletion 
		session = CloudSessionFactory.getInstance().openSession();
		try { 
			Transaction txn = session.beginTransaction();
			bucket = (SBucket)session.get(SBucket.class, bucketId);
			txn.commit();
			 
			Assert.assertTrue(bucket == null);
		} finally { 
			session.close();
		} 
    } 
     
    public void testSObject() { 
    	SHost host;
    	SBucket bucket;
    	Session session;
    	SObject sobject;
    	 
    	// setup  
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: commit
			FullTextSession session = fullTextSessionBuilder.openFullTextSession();
			Assert.assertEquals( 0, LeakingOptimizer.getTotalOperations() );
 
			Transaction tx = session.beginTransaction();
			session.persist( new Document( "The Book", "many paper pages assembled together at one side", "[old language you don't understand]" ) );
			tx.commit();
 
			Assert.assertEquals( 1, LeakingOptimizer.getTotalOperations() );
			Assert.assertEquals( 1, LeakingLuceneBackend.getLastProcessedQueue().size() );
 
			tx = session.beginTransaction();
			List list = session.createFullTextQuery( new MatchAllDocsQuery() ).list();
			Document doc = (Document) list.get( 0 );
			doc.setSummary( "Example of what was used in ancient times to read" ); 
			tx.commit();
 
			Assert.assertEquals( 1, LeakingLuceneBackend.getLastProcessedQueue().size() );
			Assert.assertEquals( expectedBackendOperations, LeakingOptimizer.getTotalOperations() );
		} 
		finally { 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Hibernate ORM Transaction Methods: