Package org.hibernate

Examples of org.hibernate.StaleObjectStateException


      if ( !versionType.isEqual(version, currentVersion) ) {
        if ( session.getFactory().getStatistics().isStatisticsEnabled() ) {
          session.getFactory().getStatisticsImplementor()
              .optimisticFailure( persister.getEntityName() );
        }
        throw new StaleObjectStateException( persister.getEntityName(), id );
      }
    }

  }
View Full Code Here


      else if ( isVersionChanged( entity, source, persister, target ) ) {
        if ( source.getFactory().getStatistics().isStatisticsEnabled() ) {
          source.getFactory().getStatisticsImplementor()
              .optimisticFailure( entityName );
        }
        throw new StaleObjectStateException( entityName, id );
      }
 
      // cascade first, so that all unsaved objects get their
      // copy created before we actually copy
      cascadeOnMerge(source, persister, entity, copyCache);
View Full Code Here

        getVersionType().nullSafeSet( st, nextVersion, 1, session );
        getIdentifierType().nullSafeSet( st, id, 2, session );
        getVersionType().nullSafeSet( st, currentVersion, 2 + getIdentifierColumnSpan(), session );
        int rows = st.executeUpdate();
        if ( rows != 1 ) {
          throw new StaleObjectStateException( getEntityName(), id );
        }
      }
      finally {
        session.getBatcher().closeStatement( st );
      }
View Full Code Here

      if ( !isNullableTable( tableNumber ) ) {
        if ( getFactory().getStatistics().isStatisticsEnabled() ) {
          getFactory().getStatisticsImplementor()
              .optimisticFailure( getEntityName() );
        }
        throw new StaleObjectStateException( getEntityName(), id );
      }
      return false;
    }
    catch( TooManyRowsAffectedException e ) {
      throw new HibernateException(
View Full Code Here

        //do we even really need this? the update will fail anyway....
        if ( session.getFactory().getStatistics().isStatisticsEnabled() ) {
          session.getFactory().getStatisticsImplementor()
              .optimisticFailure( persister.getEntityName() );
        }
        throw new StaleObjectStateException( persister.getEntityName(), id );
      }
      else {
        return snapshot;
      }
    }
View Full Code Here

        getVersionType().nullSafeSet( st, nextVersion, 1, session );
        getIdentifierType().nullSafeSet( st, id, 2, session );
        getVersionType().nullSafeSet( st, currentVersion, 2 + getIdentifierColumnSpan(), session );
        int rows = st.executeUpdate();
        if ( rows != 1 ) {
          throw new StaleObjectStateException( getEntityName(), id );
        }
      }
      finally {
        session.getBatcher().closeStatement( st );
      }
View Full Code Here

      if ( !isNullableTable( tableNumber ) ) {
        if ( getFactory().getStatistics().isStatisticsEnabled() ) {
          getFactory().getStatisticsImplementor()
              .optimisticFailure( getEntityName() );
        }
        throw new StaleObjectStateException( getEntityName(), id );
      }
    }
    catch( TooManyRowsAffectedException e ) {
      throw new HibernateException(
          "Duplicate identifier in table for: " +
View Full Code Here

      if ( !versionType.isEqual(version, currentVersion) ) {
        if ( session.getFactory().getStatistics().isStatisticsEnabled() ) {
          session.getFactory().getStatisticsImplementor()
              .optimisticFailure( persister.getEntityName() );
        }
        throw new StaleObjectStateException( persister.getEntityName(), id );
      }
    }

  }
View Full Code Here

      else if ( isVersionChanged( entity, source, persister, target ) ) {
        if ( source.getFactory().getStatistics().isStatisticsEnabled() ) {
          source.getFactory().getStatisticsImplementor()
              .optimisticFailure( entityName );
        }
        throw new StaleObjectStateException( entityName, id );
      }
 
      // cascade first, so that all unsaved objects get their
      // copy created before we actually copy
      cascadeOnMerge(source, persister, entity, copyCache);
View Full Code Here

        }

        int affected = st.executeUpdate();
        if ( affected < 0 ) {
          factory.getStatisticsImplementor().optimisticFailure( lockable.getEntityName() );
          throw new StaleObjectStateException( lockable.getEntityName(), id );
        }

      }
      finally {
        session.getBatcher().closeStatement( st );
View Full Code Here

TOP

Related Classes of org.hibernate.StaleObjectStateException

Copyright © 2018 www.massapicom. 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.