You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Josh Wyatt (JIRA)" <ji...@apache.org> on 2009/01/30 15:44:00 UTC

[jira] Created: (DBCP-282) defaultReadOnly not honored in server.xml for PerUserPoolDataSource

defaultReadOnly not honored in server.xml for PerUserPoolDataSource
-------------------------------------------------------------------

                 Key: DBCP-282
                 URL: https://issues.apache.org/jira/browse/DBCP-282
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 1.2.2
         Environment: Tomcat 4.1.29/Apache-2.0.55/Oracle JDBC on RedHat ES3.0 on i386
            Reporter: Josh Wyatt


Running dbcp-1.2.2 on Apache-2.0.55/Tomcat-4.1.29/Jakarta on Linux, using JDBC to connect to Oracle 10g DB.

We are seeing the constant SET TRANSACTION READ WRITE activity against the DB connection, and although I appreciate the discussion about a new configuration option, I am not able to figure out how to disable this activity.

Background on this issue can be found at:
http://issues.apache.org/jira/browse/DBCP-178

For reference, assume that we do not have control over the codebase, although we have full control over the server configuration (server.xml, etc).

I found the configuration options page for DBCP- but there appears to be no discussion on the logistics/mechanics of how to set or change these configuration options.

Our connections are implemented as  type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource" in server.xml.  We have tried setting the parameter in the ResourceParams section for the JDBC stanza, like this:

<ResourceParams name="jdbc/OURDBINSTANCENAME">
  <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory</value>
   </parameter>
   <parameter>
      <name>defaultReadOnly</name>
      <value>notset</value>
   </parameter>
...
</ResourceParams>

...with no success.

It should be noted that previous to discovering this issue, we did not have this parameter set at all; so I'm not even sure if this is the proper location for this configuration directive.  I could not find any guidance in the DBCP documentation on where to put this stuff.

Please advise,
Josh


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


[jira] Commented: (DBCP-282) defaultReadOnly not honored in server.xml for PerUserPoolDataSource

Posted by "Josh Wyatt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668888#action_12668888 ] 

Josh Wyatt commented on DBCP-282:
---------------------------------

Experimentally, I set the value to 'true' and now I note that the SQL generated issues 'SET TRANSACTION READ ONLY' instead of 'SET TRANSACTION READ WRITE.'  So, two things to note.  Firstly, the config item is in the right place (since changing the value between false and true changes the behavior), and secondly, 'unset' is not honored in this configuration location.


> defaultReadOnly not honored in server.xml for PerUserPoolDataSource
> -------------------------------------------------------------------
>
>                 Key: DBCP-282
>                 URL: https://issues.apache.org/jira/browse/DBCP-282
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Tomcat 4.1.29/Apache-2.0.55/Oracle JDBC on RedHat ES3.0 on i386
>            Reporter: Josh Wyatt
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Running dbcp-1.2.2 on Apache-2.0.55/Tomcat-4.1.29/Jakarta on Linux, using JDBC to connect to Oracle 10g DB.
> We are seeing the constant SET TRANSACTION READ WRITE activity against the DB connection, and although I appreciate the discussion about a new configuration option, I am not able to figure out how to disable this activity.
> Background on this issue can be found at:
> http://issues.apache.org/jira/browse/DBCP-178
> For reference, assume that we do not have control over the codebase, although we have full control over the server configuration (server.xml, etc).
> I found the configuration options page for DBCP- but there appears to be no discussion on the logistics/mechanics of how to set or change these configuration options.
> Our connections are implemented as  type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource" in server.xml.  We have tried setting the parameter in the ResourceParams section for the JDBC stanza, like this:
> <ResourceParams name="jdbc/OURDBINSTANCENAME">
>   <parameter>
>       <name>factory</name>
>       <value>org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory</value>
>    </parameter>
>    <parameter>
>       <name>defaultReadOnly</name>
>       <value>notset</value>
>    </parameter>
> ...
> </ResourceParams>
> ...with no success.
> It should be noted that previous to discovering this issue, we did not have this parameter set at all; so I'm not even sure if this is the proper location for this configuration directive.  I could not find any guidance in the DBCP documentation on where to put this stuff.
> Please advise,
> Josh

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


[jira] Commented: (DBCP-282) defaultReadOnly not honored in server.xml for PerUserPoolDataSource

Posted by "Josh Wyatt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBCP-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669979#action_12669979 ] 

Josh Wyatt commented on DBCP-282:
---------------------------------

I was able to get the desired behavior using commons-dbcp-1.2.2 with the following patch against PerUserPoolDataSource.java.
This was a backport of a similar code change noted in 1.3, and congruent with the research/recommendation in DBCP-178.

--- commons-dbcp-1.2.2-src/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java      2007-03-25 17:51:25.000000000 -0400
+++ commons-dbcp-1.2.2b-src/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java     2009-01-31 09:36:31.000000000 -0500
@@ -419,7 +419,9 @@
         if (defaultTransactionIsolation != UNKNOWN_TRANSACTIONISOLATION) {
             con.setTransactionIsolation(defaultTransactionIsolation);
         }
-        con.setReadOnly(defaultReadOnly);
+        if (con.isReadOnly() != defaultReadOnly) {
+           con.setReadOnly(defaultReadOnly);
+       }
     }
 
     /**

Our testing indicates that this completely disables the defaultReadOnly parameter for PerUserPoolDataSource, which may not be desirable for some users.

> defaultReadOnly not honored in server.xml for PerUserPoolDataSource
> -------------------------------------------------------------------
>
>                 Key: DBCP-282
>                 URL: https://issues.apache.org/jira/browse/DBCP-282
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Tomcat 4.1.29/Apache-2.0.55/Oracle JDBC on RedHat ES3.0 on i386
>            Reporter: Josh Wyatt
>             Fix For: 1.3
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Running dbcp-1.2.2 on Apache-2.0.55/Tomcat-4.1.29/Jakarta on Linux, using JDBC to connect to Oracle 10g DB.
> We are seeing the constant SET TRANSACTION READ WRITE activity against the DB connection, and although I appreciate the discussion about a new configuration option, I am not able to figure out how to disable this activity.
> Background on this issue can be found at:
> http://issues.apache.org/jira/browse/DBCP-178
> For reference, assume that we do not have control over the codebase, although we have full control over the server configuration (server.xml, etc).
> I found the configuration options page for DBCP- but there appears to be no discussion on the logistics/mechanics of how to set or change these configuration options.
> Our connections are implemented as  type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource" in server.xml.  We have tried setting the parameter in the ResourceParams section for the JDBC stanza, like this:
> <ResourceParams name="jdbc/OURDBINSTANCENAME">
>   <parameter>
>       <name>factory</name>
>       <value>org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory</value>
>    </parameter>
>    <parameter>
>       <name>defaultReadOnly</name>
>       <value>notset</value>
>    </parameter>
> ...
> </ResourceParams>
> ...with no success.
> It should be noted that previous to discovering this issue, we did not have this parameter set at all; so I'm not even sure if this is the proper location for this configuration directive.  I could not find any guidance in the DBCP documentation on where to put this stuff.
> Please advise,
> Josh

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


[jira] Closed: (DBCP-282) defaultReadOnly not honored in server.xml for PerUserPoolDataSource

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz closed DBCP-282.
----------------------------

       Resolution: Duplicate
    Fix Version/s: 1.3

This has been (mostly) fixed in svn trunk,  r558850 as the fix for DBCP-207.   What remains to fully complete the fix is making defaultReadOnly a Boolean (as it is in BasicDataSource) so that leaving the value unset ensures that the driver default is used.  With the changes in r558850, if false is not the driver default, users will have to configure the property to match the driver default if this is the desired behavior.   The general issue of uniformly using objects instead of primitives to represent configuration properties is being tracked in DBCP-234.

> defaultReadOnly not honored in server.xml for PerUserPoolDataSource
> -------------------------------------------------------------------
>
>                 Key: DBCP-282
>                 URL: https://issues.apache.org/jira/browse/DBCP-282
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Tomcat 4.1.29/Apache-2.0.55/Oracle JDBC on RedHat ES3.0 on i386
>            Reporter: Josh Wyatt
>             Fix For: 1.3
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Running dbcp-1.2.2 on Apache-2.0.55/Tomcat-4.1.29/Jakarta on Linux, using JDBC to connect to Oracle 10g DB.
> We are seeing the constant SET TRANSACTION READ WRITE activity against the DB connection, and although I appreciate the discussion about a new configuration option, I am not able to figure out how to disable this activity.
> Background on this issue can be found at:
> http://issues.apache.org/jira/browse/DBCP-178
> For reference, assume that we do not have control over the codebase, although we have full control over the server configuration (server.xml, etc).
> I found the configuration options page for DBCP- but there appears to be no discussion on the logistics/mechanics of how to set or change these configuration options.
> Our connections are implemented as  type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource" in server.xml.  We have tried setting the parameter in the ResourceParams section for the JDBC stanza, like this:
> <ResourceParams name="jdbc/OURDBINSTANCENAME">
>   <parameter>
>       <name>factory</name>
>       <value>org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory</value>
>    </parameter>
>    <parameter>
>       <name>defaultReadOnly</name>
>       <value>notset</value>
>    </parameter>
> ...
> </ResourceParams>
> ...with no success.
> It should be noted that previous to discovering this issue, we did not have this parameter set at all; so I'm not even sure if this is the proper location for this configuration directive.  I could not find any guidance in the DBCP documentation on where to put this stuff.
> Please advise,
> Josh

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


[jira] Updated: (DBCP-282) defaultReadOnly not honored in server.xml for PerUserPoolDataSource

Posted by "Josh Wyatt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBCP-282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Wyatt updated DBCP-282:
----------------------------

    Attachment: patch.commons-dbcp-1.2.2-transaction.diff

Note the pasted version of the patch got a little garbled due to changing some chars, poor formatting, etc; this is the actual diff for the patch.


> defaultReadOnly not honored in server.xml for PerUserPoolDataSource
> -------------------------------------------------------------------
>
>                 Key: DBCP-282
>                 URL: https://issues.apache.org/jira/browse/DBCP-282
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Tomcat 4.1.29/Apache-2.0.55/Oracle JDBC on RedHat ES3.0 on i386
>            Reporter: Josh Wyatt
>             Fix For: 1.3
>
>         Attachments: patch.commons-dbcp-1.2.2-transaction.diff
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Running dbcp-1.2.2 on Apache-2.0.55/Tomcat-4.1.29/Jakarta on Linux, using JDBC to connect to Oracle 10g DB.
> We are seeing the constant SET TRANSACTION READ WRITE activity against the DB connection, and although I appreciate the discussion about a new configuration option, I am not able to figure out how to disable this activity.
> Background on this issue can be found at:
> http://issues.apache.org/jira/browse/DBCP-178
> For reference, assume that we do not have control over the codebase, although we have full control over the server configuration (server.xml, etc).
> I found the configuration options page for DBCP- but there appears to be no discussion on the logistics/mechanics of how to set or change these configuration options.
> Our connections are implemented as  type="org.apache.commons.dbcp.datasources.PerUserPoolDataSource" in server.xml.  We have tried setting the parameter in the ResourceParams section for the JDBC stanza, like this:
> <ResourceParams name="jdbc/OURDBINSTANCENAME">
>   <parameter>
>       <name>factory</name>
>       <value>org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory</value>
>    </parameter>
>    <parameter>
>       <name>defaultReadOnly</name>
>       <value>notset</value>
>    </parameter>
> ...
> </ResourceParams>
> ...with no success.
> It should be noted that previous to discovering this issue, we did not have this parameter set at all; so I'm not even sure if this is the proper location for this configuration directive.  I could not find any guidance in the DBCP documentation on where to put this stuff.
> Please advise,
> Josh

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