Examples of OptimisticLockException


Examples of org.hibernate.OptimisticLockException

      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.
View Full Code Here

Examples of org.hibernate.OptimisticLockException

  }

  @Override
  public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session) {
    if ( !lockable.isVersioned() ) {
      throw new OptimisticLockException( object, "[" + 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.
View Full Code Here

Examples of org.hibernate.OptimisticLockException

  public void doBeforeTransactionCompletion(SessionImplementor session) {
    final EntityPersister persister = entry.getPersister();

    Object latestVersion = persister.getCurrentVersion( entry.getId(), session );
    if ( !entry.getVersion().equals( latestVersion ) ) {
      throw new OptimisticLockException(
          "Newer version [" + latestVersion +
              "] of entity [" + MessageHelper.infoString( entry.getEntityName(), entry.getId() ) +
              "] found in database"
      );
    }
View Full Code Here

Examples of quickdb.exception.OptimisticLockException

     * @param Object
     * @return True if the modification was successfull, False in the other case
     */
    public boolean modify(Object object) {
        if(!this.manager.checkOptimisticLock(this, object)){
            throw new OptimisticLockException();
        }
        boolean value = false;
        try{
            boolean commitValue = this.commit;
            if(this.commit || this.autoCommit){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.