Code example for SessionImplementor

Methods: getPersistenceContext

0
	/** 
	 * @see LockingStrategy#lock 
	 */ 
	public void lock( 
			Serializable id,
			Object version, 
			Object object, 
			int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
		if ( !lockable.isVersioned() ) {
			throw new HibernateException( "[" + lockMode + "] not supported for non-versioned entities [" + lockable.getEntityName() + "]" );
		} 
		EntityEntry entry = session.getPersistenceContext().getEntry( object );
		EntityIncrementVersionProcess incrementVersion = new EntityIncrementVersionProcess( object, entry );
		EventSource source = (EventSource) session;
		// Register the EntityIncrementVersionProcess action to run just prior to transaction commit.  
		source.getActionQueue().registerProcess( incrementVersion );
	} 
 
	protected LockMode getLockMode() {
		return lockMode;