jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Pfister" <dominique.pfis...@day.com>
Subject Re: DatabaseJournal doesn't work with springmodules
Date Wed, 28 Mar 2007 07:46:40 GMT
Hi Rafał,

judging from the fact that the revision id is incremented twice and
then applied to two different records, I ask myself whether these
records are appended from the *same* thread in the *same* instance.
When appending a record to the DatabaseJournal, the order of SQL calls
is as follows:

-- BEGIN TRANSACTION --
UPDATE global_revision SET revision_id = revision_id + 1
SELECT revision_id FROM global_revision
INSERT INTO revision(revision_id, ...) VALUES (?,...)
-- COMMIT --

The first call is supposed to lock the global_revision table, the
second will fetch the new revision_id and the last one will append a
record with that new revision_id. If two instances would get the same
revision_id, something would be seriously strange with the database
transaction isolation. Two different threads in the same instance
block each other until one has actually finished appending the new
record. Therefore, the only conceivable scenario are  reentrant
updates made by the same thread.

Can you reproduce your situation with a simple test case? This would
definitely help...

Kind regards
Dominique

On 3/27/07, Rafał Kwiecień <rafal@consol.pl> wrote:
> Hi Dominique
>
> Dnia wtorek, 27 marca 2007 09:47, Dominique Pfister napisał:
> > Hi Rafał,
> >
> > the JournalException should contain the root SQLException as well,
> > which should give a hint about the actual problem. Don't you see it
> > anywhere in the logs?
>
> java.sql.SQLException: ORA-00001: unique constraint
> (RAFAL_TMP.JCR_07_JOURNAL_IDX) violated
>  at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
>  at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
>  at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:590)
>  at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1973)
>  at oracle.jdbc.ttc7.TTC7Protocol.executeFetch(TTC7Protocol.java:977)
>  at
> oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2205)
>  at
> oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2064)
>  at
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2989)
>  at
> oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
>  at
> oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:736)
>  at
> org.apache.jackrabbit.core.journal.DatabaseJournal.append(DatabaseJournal.java:293)
>  ... 24 more
>
> It seems like revision 2, revision 4 and revision 6 are appended twice. But
> nothing in logs about revision 1, 3 or 5.
>
> I attached log file.
>
> --
> Rafał Kwiecień
> ConSol* Consulting & Solutions Software Poland Sp. z o.o.
> ul. Piastowska 44C, 30-070 Kraków
> http://www.consol.pl/
>
>
Mime
View raw message