Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.LockException


          break;
        }
      }
      switch (errorType) {
        case StoreException.LOCK:
              return new LockException(msg);
        case StoreException.OBJECT_EXISTS:
              return new ObjectExistsException(msg);
        case StoreException.OBJECT_NOT_FOUND:
              return new ObjectNotFoundException(msg);
        case StoreException.OPTIMISTIC:
View Full Code Here


     * implementation of checking lock from the result set.
     */
    protected void checkLock(ResultSet rs, OpenJPAStateManager sm)
        throws SQLException {
        if (!rs.next())
            throw new LockException(sm.getManagedInstance());
        return;
    }
View Full Code Here

          break;
        }
      }
      switch (errorType) {
        case StoreException.LOCK:
              return new LockException(msg);
        case StoreException.OBJECT_EXISTS:
              return new ObjectExistsException(msg);
        case StoreException.OBJECT_NOT_FOUND:
              return new ObjectNotFoundException(msg);
        case StoreException.OPTIMISTIC:
View Full Code Here

                    }
                }
            }
            rs = stmnt.executeQuery();
            if (!rs.next())
                throw new LockException(sm.getManagedInstance());
        } catch (SQLException se) {
            throw SQLExceptions.getStore(se, dict);
        } finally {
            if (stmnt != null)
                try { stmnt.close(); } catch (SQLException se) {}
View Full Code Here

    OpenJPAException narrow(String msg, SQLException ex, Object failed) {
        int errorType = matchErrorState(sqlStateCodes, ex);
        StoreException storeEx;
        switch (errorType) {
        case StoreException.LOCK:
            storeEx = new LockException(failed);
            break;
        case StoreException.OBJECT_EXISTS:
            storeEx = new ObjectExistsException(msg);
            break;
        case StoreException.OBJECT_NOT_FOUND:
View Full Code Here

     */
    public static OpenJPAException narrow(String msg, SQLException se,
        DBDictionary dict) {
        String e = se.getSQLState();
        if (dict.getSQLStates(StoreException.LOCK).contains(e))
            return new LockException(msg);
        else if (dict.getSQLStates(StoreException.OBJECT_EXISTS).contains(e))
            return new ObjectExistsException(msg);
        else if (dict.getSQLStates(StoreException.OBJECT_NOT_FOUND).contains(e))
            return new ObjectNotFoundException(msg);
        else if (dict.getSQLStates(StoreException.OPTIMISTIC).contains(e))
View Full Code Here

     * implementation of checking lock from the result set.
     */
    protected void checkLock(ResultSet rs, OpenJPAStateManager sm, int timeout)
        throws SQLException {
        if (!rs.next())
            throw new LockException(sm.getManagedInstance(), timeout);
        return;
    }
View Full Code Here

            msg = se.getClass().getName();
        SQLException[] ses = getSQLExceptions(se);
        OpenJPAException storeEx = (dict == null) ? new StoreException(msg).setFailedObject(failed)
                .setNestedThrowables(ses) : dict.newStoreException(msg, ses, failed);
        if (level != -1 && storeEx.getSubtype() == StoreException.LOCK) {
            LockException lockEx = (LockException) storeEx;
            lockEx.setLockLevel(level);
        }
        return storeEx;
    }
View Full Code Here

            }
        }
        StoreException storeEx;
        switch (errorType) {
        case StoreException.LOCK:
            storeEx = new LockException(msg);
            break;
        case StoreException.OBJECT_EXISTS:
            storeEx = new ObjectExistsException(msg);
            break;
        case StoreException.OBJECT_NOT_FOUND:
View Full Code Here

              e = new org.apache.openjpa.persistence.OptimisticLockException
                    (ke.getMessage(), getNestedThrowables(ke),
                        getFailedObject(ke), ke.isFatal());
        } else if (ke.getSubtype() == StoreException.LOCK
                || cause instanceof LockException) {
            LockException lockEx = (LockException)
                (ke instanceof LockException ? ke : cause);
            if (lockEx != null && lockEx.getLockLevel() >=
                MixedLockLevels.LOCK_PESSIMISTIC_READ) {
                if (!lockEx.isFatal()) {
                    e = new org.apache.openjpa.persistence
                        .LockTimeoutException(
                        ke.getMessage(), getNestedThrowables(ke),
                        getFailedObject(ke), ke.isFatal());
                } else {
View Full Code Here

TOP

Related Classes of org.apache.openjpa.util.LockException

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.