You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Stefano Bertini (JIRA)" <ji...@apache.org> on 2010/03/17 22:39:27 UTC
[jira] Created: (CONFIGURATION-412) Cannot use
DatabaseConfiguration if the datasource has autocommit = false
Cannot use DatabaseConfiguration if the datasource has autocommit = false
-------------------------------------------------------------------------
Key: CONFIGURATION-412
URL: https://issues.apache.org/jira/browse/CONFIGURATION-412
Project: Commons Configuration
Issue Type: Bug
Affects Versions: 1.2
Environment: Windows / Linux - Database Oracle 11
Reporter: Stefano Bertini
Priority: Critical
If using a DatabaseConfiguration object with a datasource that has *autocommit = false*, the setProperty method fails with a *duplicate key* error.
This happens because in the setProperty method the two calls _clearProperty(key)_ and _addProperty(key, value)_ can retrieve two different connections from the database.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CONFIGURATION-412) Cannot use
DatabaseConfiguration if the datasource has autocommit = false
Posted by "Stefano Bertini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONFIGURATION-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846986#action_12846986 ]
Stefano Bertini commented on CONFIGURATION-412:
-----------------------------------------------
I think that the DatabaseConfiguration should always perform a commit, otherwise the class would not be usable without autocommit = true.
Infact, without autocommit = true, sql statements issued by the code would never be committed to the database.
> Cannot use DatabaseConfiguration if the datasource has autocommit = false
> -------------------------------------------------------------------------
>
> Key: CONFIGURATION-412
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-412
> Project: Commons Configuration
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: Windows / Linux - Database Oracle 11
> Reporter: Stefano Bertini
> Priority: Critical
>
> If using a DatabaseConfiguration object with a datasource that has *autocommit = false*, the setProperty method fails with a *duplicate key* error.
> This happens because in the setProperty method the two calls _clearProperty(key)_ and _addProperty(key, value)_ can retrieve two different connections from the database.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CONFIGURATION-412) Cannot use
DatabaseConfiguration if the datasource has autocommit = false
Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONFIGURATION-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846783#action_12846783 ]
Oliver Heger commented on CONFIGURATION-412:
--------------------------------------------
Would it be a solution to provide an implementation of {{setProperty()}} that issues a single UPDATE statement? Or should {{DatabaseConfiguration}} be extended to perform commits if configured?
> Cannot use DatabaseConfiguration if the datasource has autocommit = false
> -------------------------------------------------------------------------
>
> Key: CONFIGURATION-412
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-412
> Project: Commons Configuration
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: Windows / Linux - Database Oracle 11
> Reporter: Stefano Bertini
> Priority: Critical
>
> If using a DatabaseConfiguration object with a datasource that has *autocommit = false*, the setProperty method fails with a *duplicate key* error.
> This happens because in the setProperty method the two calls _clearProperty(key)_ and _addProperty(key, value)_ can retrieve two different connections from the database.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CONFIGURATION-412) Cannot use
DatabaseConfiguration if the datasource has autocommit = false
Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONFIGURATION-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847571#action_12847571 ]
Oliver Heger commented on CONFIGURATION-412:
--------------------------------------------
I agree that for autocommit = false manual commits are required. However, I assume we would break applications that use autocommit = true if we always did a commit. Therefore I think the commit mode should be configurable.
> Cannot use DatabaseConfiguration if the datasource has autocommit = false
> -------------------------------------------------------------------------
>
> Key: CONFIGURATION-412
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-412
> Project: Commons Configuration
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: Windows / Linux - Database Oracle 11
> Reporter: Stefano Bertini
> Priority: Critical
>
> If using a DatabaseConfiguration object with a datasource that has *autocommit = false*, the setProperty method fails with a *duplicate key* error.
> This happens because in the setProperty method the two calls _clearProperty(key)_ and _addProperty(key, value)_ can retrieve two different connections from the database.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CONFIGURATION-412) Cannot use
DatabaseConfiguration if the datasource has autocommit = false
Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONFIGURATION-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oliver Heger resolved CONFIGURATION-412.
----------------------------------------
Resolution: Fixed
Fix Version/s: 1.7
A fix was applied in SVN revision 931667 (and also ported to the configuration2 branch).
{{DatabaseConfiguration}} now provides additional constructors that allow setting a flag whether commits should be performed on the connection obtained from the data source. Per default, this flag is *false*, so that the behavior of the configuration class is not changed when using the old constructors.
Note that we currently do not perform a rollback if an exception occurs. This does not seem to be necessary.
> Cannot use DatabaseConfiguration if the datasource has autocommit = false
> -------------------------------------------------------------------------
>
> Key: CONFIGURATION-412
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-412
> Project: Commons Configuration
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: Windows / Linux - Database Oracle 11
> Reporter: Stefano Bertini
> Assignee: Oliver Heger
> Priority: Critical
> Fix For: 1.7
>
>
> If using a DatabaseConfiguration object with a datasource that has *autocommit = false*, the setProperty method fails with a *duplicate key* error.
> This happens because in the setProperty method the two calls _clearProperty(key)_ and _addProperty(key, value)_ can retrieve two different connections from the database.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.