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

This code example shows how to use the following methods:
	 * @see org.hibernate.dialect.lock.LockingStrategy#lock 
	 */ 
	public void lock( 
      Serializable id,
      Object version, 
      Object object, 
      int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
		if ( !lockable.isVersioned() ) {
			throw new OptimisticLockException( "[" + lockMode + "] not supported for non-versioned entities [" + lockable.getEntityName() + "]" );
		} 
		EntityEntry entry = session.getPersistenceContext().getEntry(object);
		EventSource source = (EventSource)session;
		EntityVerifyVersionProcess verifyVersion = new EntityVerifyVersionProcess(object, entry);
		// Register the EntityVerifyVersionProcess action to run just prior to transaction commit. 
		source.getActionQueue().registerProcess(verifyVersion);
	} 
 
	protected LockMode getLockMode() {
		return lockMode;
	} 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java