jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel May (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1013) Connection.setAutoCommit(...) fails if connection is managed for JNDIDatabasePersistenceManager
Date Mon, 09 Jul 2007 17:56:04 GMT

    [ https://issues.apache.org/jira/browse/JCR-1013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511201
] 

Marcel  May commented on JCR-1013:
----------------------------------

Yes, thanks.

For DatabasePersistenceManager there is no auto commit enabled, for DatabaseFileSystem auto
commit is enabled.

I wrote the other day a mail to the dev list about TX handling and JTA as some impl parts
and the spec are confusing me (see http://mail-archives.apache.org/mod_mbox/jackrabbit-dev/200707.mbox/%3c4691F684.4080703@consol.de%3e).

> Connection.setAutoCommit(...) fails if connection is managed for JNDIDatabasePersistenceManager
> -----------------------------------------------------------------------------------------------
>
>                 Key: JCR-1013
>                 URL: https://issues.apache.org/jira/browse/JCR-1013
>             Project: Jackrabbit
>          Issue Type: Bug
>    Affects Versions: 1.3
>         Environment: JBoss, Jackrabbit 1.3,  JNDIDatabasePersistenceManager
>            Reporter: Marcel  May
>         Attachments: patch.txt
>
>
> Invoking setAutoCommit() on a db connection fails if the connection is managed.
> I propose as a workaround to check if the auto commit must be set previous to setting
it (a trivial patch will be provided).
> This can happen eg. if you use JNDI (eg JNDIDatabasePersistenceManager) to fetch the
connection on JBoss, and the persistent manager tries to reconnect (see stack trace below).
> 05 Jul 09:54:24 ERROR sePersistenceManager| failed to re-establish connection
> java.sql.SQLException: You cannot set autocommit during a managed transaction!
>         at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnection.java:482)
>         at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:322)
>         at org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.initConnection(DatabasePersistenceManager.java:731)
>         at org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.reestablishConnection(DatabasePersistenceManager.java:806)
>         at org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.executeStmt(DatabasePersistenceManager.java:852)
>         at org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.exists(DatabasePersistenceManager.java:647)
>         at org.apache.jackrabbit.core.state.SharedItemStateManager.hasNonVirtualItemState(SharedItemStateManager.java:1102)
>         at org.apache.jackrabbit.core.state.SharedItemStateManager.hasItemState(SharedItemStateManager.java:289)
>         at org.apache.jackrabbit.core.state.LocalItemStateManager.hasItemState(LocalItemStateManager.java:180)
>         at org.apache.jackrabbit.core.state.XAItemStateManager.hasItemState(XAItemStateManager.java:252)
>         at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:174)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message