jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-1013) Connection.setAutoCommit(...) fails if connection is managed for JNDIDatabasePersistenceManager
Date Fri, 05 Oct 2007 13:56:50 GMT

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

Jukka Zitting updated JCR-1013:
-------------------------------

          Component/s: jackrabbit-core
        Fix Version/s: 1.4
    Affects Version/s: 1.3.3
                       1.3.1

> 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
>          Components: jackrabbit-core
>    Affects Versions: 1.3, 1.3.1, 1.3.3
>         Environment: JBoss, Jackrabbit 1.3,  JNDIDatabasePersistenceManager
>            Reporter: Marcel  May
>             Fix For: 1.4
>
>         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