Code example for JDBCException

Methods: getErrorCode

0
			// expected result (if using versioned batching)... 
		} 
		catch( JDBCException e ) {
			// SQLServer will report this condition via a SQLException 
			// when using its SNAPSHOT transaction isolation... 
			if ( ! ( getDialect() instanceof SQLServerDialect && e.getErrorCode() == 3960 ) ) {
				throw e;
			} 
			else { 
				// it seems to "lose track" of the transaction as well... 
				mainSession.getTransaction().rollback();
				mainSession.beginTransaction();
			} 
		} 
		mainSession.clear();
		mainSession.getTransaction().commit();
		mainSession.close();
 
		mainSession = openSession();
		mainSession.beginTransaction();
Connect your IDE to all the code out there  Get Codota for Java