Subject | tpb mapping, tomcat, dbcp, overriding defaults |
---|---|
Author | unordained |
Post date | 2008-08-18T16:12:10Z |
The default TPB mappings are not the ones I want, but I can't get the driver to override the
default settings. All I really want is _nowait instead of _wait. Here's what I've tried (that
hasn't worked yet, despite lots of restarting tomcat, redeploying the web-app, and looking through
log files for any errors thrown by the FB driver):
Tomcat 6, jaybird 2.1.6, with DBCP
- modifying the isc_tpb_mapping.properties file in the .jar itself that is in tomcat's /lib
- setting tpbMapping attribute of the Resource element of server.xml, and creating my own file
- setting tpbMapping as an attribute in the connection URL in server.xml, and creating my own file
- setting tpb_mapping attribute of the Resource element of server.xml, and creating my own file
- setting TRANSACTION_REPEATABLE_READ attribute of the Resource element
- setting TRANSACTION_REPEATABLE_READ attribute of the URL in server.xml
Can anyone tell me what I *actually* should do to override the default mappings when using Tomcat
with DBCP? Here's my current resource.xml snippet:
<Resource auth="Container" validationQuery="select 1 from rdb$database"
defaultTransactionIsolation="REPEATABLE_READ" driverClassName="org.firebirdsql.jdbc.FBDriver"
logAbandoned="true" name="********" password="********" removeAbandoned="true"
removeAbandonedTimeout="300" type="javax.sql.DataSource"
url="jdbc:firebirdsql:localhost/3050:********.fdb?
autoReconnect=true&defaultResultSetHoldable=true" maxActive="100" maxIdle="10" maxWait="1000"
username="********"/>
Various javadocs throughout Jaybird indicate that these and other methods are allowed; I see stuff
like "isc_tpb_" prefix is not required, but see no code to support it; I see stuff about throwing
exceptions if a bad isc_tpb is specified, but I see no errors when I attempt to override, whether
with good comma-separated list or not, or removing the custom properties file, ... I see different
constants for these properties, such as "tpbMapping" vs. "tpb_mapping", and can't tell which ones
apply to tomcat configs. I'm very confused. Previous entries on this same list haven't seemed to
help me solve the problem.
If I can't find any other solution, I guess I'm left to building my own copy of the .jar, applying
a patch like the one in JDBC-21; since it seems to want to use the defaults no matter what, that
should work.
The settings I want are:
TRANSACTION_READ_COMMITTED=isc_tpb_read_committed,isc_tpb_rec_version,isc_tpb_write,isc_tpb_nowait
TRANSACTION_REPEATABLE_READ=isc_tpb_concurrency,isc_tpb_write,isc_tpb_nowait
TRANSACTION_SERIALIZABLE=isc_tpb_concurrency,isc_tpb_write,isc_tpb_nowait
(always use nowait; never use consistency, as it's complete overkill and it's easy to shoot
yourself in the foot thinking that "serializable" sounds good and "repeatable_read" sounds bad;
these are actually the jdbc names, not the equivalent in firebird-speak!)
Thanks,
-Philip
default settings. All I really want is _nowait instead of _wait. Here's what I've tried (that
hasn't worked yet, despite lots of restarting tomcat, redeploying the web-app, and looking through
log files for any errors thrown by the FB driver):
Tomcat 6, jaybird 2.1.6, with DBCP
- modifying the isc_tpb_mapping.properties file in the .jar itself that is in tomcat's /lib
- setting tpbMapping attribute of the Resource element of server.xml, and creating my own file
- setting tpbMapping as an attribute in the connection URL in server.xml, and creating my own file
- setting tpb_mapping attribute of the Resource element of server.xml, and creating my own file
- setting TRANSACTION_REPEATABLE_READ attribute of the Resource element
- setting TRANSACTION_REPEATABLE_READ attribute of the URL in server.xml
Can anyone tell me what I *actually* should do to override the default mappings when using Tomcat
with DBCP? Here's my current resource.xml snippet:
<Resource auth="Container" validationQuery="select 1 from rdb$database"
defaultTransactionIsolation="REPEATABLE_READ" driverClassName="org.firebirdsql.jdbc.FBDriver"
logAbandoned="true" name="********" password="********" removeAbandoned="true"
removeAbandonedTimeout="300" type="javax.sql.DataSource"
url="jdbc:firebirdsql:localhost/3050:********.fdb?
autoReconnect=true&defaultResultSetHoldable=true" maxActive="100" maxIdle="10" maxWait="1000"
username="********"/>
Various javadocs throughout Jaybird indicate that these and other methods are allowed; I see stuff
like "isc_tpb_" prefix is not required, but see no code to support it; I see stuff about throwing
exceptions if a bad isc_tpb is specified, but I see no errors when I attempt to override, whether
with good comma-separated list or not, or removing the custom properties file, ... I see different
constants for these properties, such as "tpbMapping" vs. "tpb_mapping", and can't tell which ones
apply to tomcat configs. I'm very confused. Previous entries on this same list haven't seemed to
help me solve the problem.
If I can't find any other solution, I guess I'm left to building my own copy of the .jar, applying
a patch like the one in JDBC-21; since it seems to want to use the defaults no matter what, that
should work.
The settings I want are:
TRANSACTION_READ_COMMITTED=isc_tpb_read_committed,isc_tpb_rec_version,isc_tpb_write,isc_tpb_nowait
TRANSACTION_REPEATABLE_READ=isc_tpb_concurrency,isc_tpb_write,isc_tpb_nowait
TRANSACTION_SERIALIZABLE=isc_tpb_concurrency,isc_tpb_write,isc_tpb_nowait
(always use nowait; never use consistency, as it's complete overkill and it's easy to shoot
yourself in the foot thinking that "serializable" sounds good and "repeatable_read" sounds bad;
these are actually the jdbc names, not the equivalent in firebird-speak!)
Thanks,
-Philip