openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2312) H2 is forced to autoCommit; breaks transactions
Date Tue, 18 Dec 2012 16:54:13 GMT


Kevin Sutter commented on OPENJPA-2312:

You did some good evaluation, but I think your issue is elsewhere...  The setting of supportsMultipleNontransactionalResultSets
to true is the default for most of the databases that OpenJPA supports.  From our documentation
[1], here's what this property is used for:

SupportsMultipleNontransactionalResultSets: When true, a nontransactional connection is capable
of having multiple open ResultSet instances.

So, although this setting is controlling the setting of autocommit in your case, I think the
real conditional is the one just previous to this where the connection factory is determined
to be managed or not...  It looks like in your scenario that the ConnectionFactory mode is
*not* managed.  In that case, then OpenJPA looks at the MultipleNontransactionalResultSets
setting to see how auto commit should be set.  Based on the description of your scenario,
I would have assumed that you wanted to run in a managed mode.

            if (factory2 || !conf.isConnectionFactoryModeManaged()) {
                if (!dict.supportsMultipleNontransactionalResultSets)

>From the javadoc...
o  boolean org.apache.openjpa.conf.OpenJPAConfiguration.isConnectionFactoryModeManaged()
Whether connections are automatically enlisted in global transactions.

So, I would look into how OpenJPA is configured with Spring.  Somehow, it looks like OpenJPA
is not running in a managed mode and, thus, the use of transactions to control the flow of
connection interactions is not happening.  Maybe more tracing from both Spring and OpenJPA
would help narrow down the issue.

> H2 is forced to autoCommit; breaks transactions
> -----------------------------------------------
>                 Key: OPENJPA-2312
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Gustavo Lopes
>         Attachments: details.txt
> DataSourceFactory::installDBDictionary() sets autocommit to TRUE on the ConfiguringConnectionDecorator
because supportsMultipleNontransactionalResultSets is true.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message