jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karan Malhi <karan.ma...@gmail.com>
Subject javax.jcr.RepositoryException: Error while creating lock.
Date Fri, 20 Jul 2012 22:06:53 GMT
Hi,

I have a lock exception which gets thrown during insertion . This exception
springs up once every few days. Here is the trace:
Caused by: javax.jcr.RepositoryException: Error while creating lock.
at
org.apache.jackrabbit.core.lock.LockManagerImpl.writeLockProperties(LockManagerImpl.java:965)

at org.apache.jackrabbit.core.lock.XALockManager.lock(XALockManager.java:82)

at
org.apache.jackrabbit.core.lock.SessionLockManager.lock(SessionLockManager.java:180)

at org.apache.jackrabbit.util.Locked.tryLock(Locked.java:301)
at org.apache.jackrabbit.util.Locked.with(Locked.java:193)
at org.apache.jackrabbit.util.Locked.with(Locked.java:124)
at org.apache.jackrabbit.util.Locked.with(Locked.java:103)
at org.mule.galaxy.impl.jcr.onm.AbstractDao$4.doInJcr(AbstractDao.java:139)
at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)
... 102 more
Caused by: org.apache.jackrabbit.core.state.ItemStateException: failed to
write property state: 627f2b8d-1d27-4814-b76f-146af08fa7d6/{
http://www.jcp.org/jcr/1.0}lockOwner
at
org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.store(DatabasePersistenceManager.java:523)

at
org.apache.jackrabbit.core.persistence.AbstractPersistenceManager.store(AbstractPersistenceManager.java:73)

at
org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.store(DatabasePersistenceManager.java:307)

at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:770)

at
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1492)

at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:400)

at
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:354)

at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:375)

at
org.apache.jackrabbit.core.lock.LockManagerImpl.writeLockProperties(LockManagerImpl.java:962)

... 110 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: The statement
was aborted because it would have caused a duplicate key value in a unique
or primary key constraint or unique index identified by
'JACKRABBIT_X0020_CORE_PROP_IDX' defined on 'JACKRABBIT_X0020_CORE_PROP'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown
Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

at org.apache.com
mons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)

at org.apache.com
mons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)

at
org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.executeStmt(DatabasePersistenceManager.java:893)

at
org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.store(DatabasePersistenceManager.java:516)

Upon further investigation, I found that Jackrabbit creates some tables in
derby, one specific table being the one shown below. The odd thing about
this table is that it has a non-unique (non-primary) column named PROP_ID,
but a unique index is being created on this column. This allows a duplicate
row to be inserted, but then the index causes a Sql Integrity Constraint
Violation. Could this be a concurrency issue? What is this table used for?
Should I do the insertion within a transaction?
CREATE TABLE APP.JACKRABBIT_X0020_CORE_PROP  (
    PROP_ID      VARCHAR(1024) NOT NULL,
    PROP_DATA    BLOB(2147483647) NOT NULL
    )
GO
CREATE UNIQUE INDEX APP.JACKRABBIT_X0020_CORE_PROP_IDX
    ON APP.JACKRABBIT_X0020_CORE_PROP(PROP_ID)
GO

-- 

Karan Singh Malhi
twitter.com/KaranSinghMalhi

Mime
View raw message