Package org.odmg

Examples of org.odmg.LockNotGrantedException


                    throw (LockNotGrantedException) t;
                }
                else
                {
                    log.error("Unexpected failure while locking", t);
                    throw new LockNotGrantedException("Locking failed for "
                            + rtObject.getIdentity()+ ", nested exception is: [" + t.getClass().getName()
                            + ": " + t.getMessage() + "]");
                }
            }
            if(cascade)
View Full Code Here


            if (lockMode == Transaction.READ)
            {
                if (log.isDebugEnabled()) log.debug("Do READ lock on object: " + oid);
                if(!lm.readLock(this, oid, obj))
                {
                    throw new LockNotGrantedException("Can not lock for READ: " + oid);
                }
            }
            else if (lockMode == Transaction.WRITE)
            {
                if (log.isDebugEnabled()) log.debug("Do WRITE lock on object: " + oid);
                if(!lm.writeLock(this, oid, obj))
                {
                    throw new LockNotGrantedException("Can not lock for WRITE: " + oid);
                }
            }
            else if (lockMode == Transaction.UPGRADE)
            {
                if (log.isDebugEnabled()) log.debug("Do UPGRADE lock on object: " + oid);
                if(!lm.upgradeLock(this, oid, obj))
                {
                    throw new LockNotGrantedException("Can not lock for UPGRADE: " + oid);
                }
            }
        }
        else
        {
View Full Code Here

            lockAndRegister(rt, Transaction.READ, isImplicitLocking(), getRegistrationList());
        }
        catch (Throwable t)
        {
            log.error("Register materialized object with this tx failed", t);
            throw new LockNotGrantedException(t.getMessage());
        }
        unregisterFromIndirectionHandler(handler);
    }
View Full Code Here

            {
                // make error log to show the full stack trace one time
                log.error("Optimistic lock exception while write objects", e);
                // PB OptimisticLockException should be clearly signalled to the user
                Object sourceObject = ((OptimisticLockException) e).getSourceObject();
                throw new LockNotGrantedException("Optimistic lock exception occur, source object was (" + sourceObject + ")," +
                        " message was (" + e.getMessage() + ")");
            }
            else if(!(e instanceof RuntimeException))
            {
                log.warn("Error while write objects for tx " + transaction, e);
View Full Code Here

            connMan.clearBatch();
            log.error("Commit on object level failed for tx " + transaction, t);
            if (t instanceof OptimisticLockException)
            {
              // PB OptimisticLockException should be clearly signalled to the user
              throw new LockNotGrantedException(t.getMessage());
            }
            else
            {
                    throw new TransactionAbortedExceptionOJB(t);
            }
View Full Code Here

        LockManager lm = LockManagerFactory.getLockManager();
        if (lockMode == Transaction.READ)
        {
            if (!lm.readLock(this, obj))
            {
                throw new LockNotGrantedException("Can not lock for READ: " + obj);
            }
        }
        else if (lockMode == Transaction.WRITE)
        {
            if (!lm.writeLock(this, obj))
            {
                throw new LockNotGrantedException("Can not lock for WRITE: " + obj);
            }
        }
        else if (lockMode == Transaction.UPGRADE)
        {
            if (!lm.upgradeLock(this, obj))
            {
                throw new LockNotGrantedException("Can not lock for UPGRADE: " + obj);
            }
        }
        try
        {
            if (log.isDebugEnabled()) log.debug("registering lock on object at " + System.currentTimeMillis());
            register(obj, lockMode);
        }
        catch (Throwable t)
        {
            log.error("Locking obj " + obj + " with lock mode " + lockMode + " failed", t);
            lm.releaseLock(this, obj);
            throw new LockNotGrantedException(t.getMessage());
        }
    }
View Full Code Here

            register(materializedObject, READ);
        }
        catch (Throwable t)
        {
            log.error("Register materialized object with this tx failed", t);
            throw new LockNotGrantedException(t.getMessage());
        }
        unregisterFromIndirectionHandler(handler);
    }
View Full Code Here

                    throw (LockNotGrantedException) t;
                }
                else
                {
                    log.error("Unexpected failure while locking", t);
                    throw new LockNotGrantedException("Locking failed for "
                            + rtObject.getIdentity()+ ", nested message is: [" + t.getCause().getClass()
                            + ": " + t.getMessage() + "]");
                }
            }
        }
View Full Code Here

            if (lockMode == Transaction.READ)
            {
                if (log.isDebugEnabled()) log.debug("Do READ lock on object: " + oid);
                if(!lm.readLock(this, oid, obj))
                {
                    throw new LockNotGrantedException("Can not lock for READ: " + oid);
                }
            }
            else if (lockMode == Transaction.WRITE)
            {
                if (log.isDebugEnabled()) log.debug("Do WRITE lock on object: " + oid);
                if(!lm.writeLock(this, oid, obj))
                {
                    throw new LockNotGrantedException("Can not lock for WRITE: " + oid);
                }
            }
            else if (lockMode == Transaction.UPGRADE)
            {
                if (log.isDebugEnabled()) log.debug("Do UPGRADE lock on object: " + oid);
                if(!lm.upgradeLock(this, oid, obj))
                {
                    throw new LockNotGrantedException("Can not lock for UPGRADE: " + oid);
                }
            }
        }
        else
        {
View Full Code Here

            lockAndRegister(rt, Transaction.READ, false);
        }
        catch (Throwable t)
        {
            log.error("Register materialized object with this tx failed", t);
            throw new LockNotGrantedException(t.getMessage());
        }
        unregisterFromIndirectionHandler(handler);
    }
View Full Code Here

TOP

Related Classes of org.odmg.LockNotGrantedException

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.