[ 
https://issues.apache.org/jira/browse/TORQUE-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14953659#comment-14953659
 ] 

Thomas Fox commented on TORQUE-340:
-----------------------------------

If I did not overlook something, the connectionInitSqls attribute is only an 
attribute of DBCP's BasicDataSource, not of DBCP's SharedPoolDataSource which 
you are using. Even in the newest DBCP package (2.1.1, which cannot be used 
currently in Torque because of java 1.6 compatibility of the runtime) I did not 
see an equivalent attribute in SharedPoolDataSource.
So it's not something that Torque misses, but it seems that it is a DBCP 
Problem. Have you tried to ask at the dbcp users mailing list?

Also, note that you can use any data source you want in Torque. You can 
implement the interface org.apache.torque.dsfactory.DataSourceFactory and use 
the class name as dsfactory value in the Torque configuration. So you can also 
use a BasicDataSource (with the config parameter you need) if you want to. 

Sorry, but due to lack of support in commons-dbcp, I can see no easy way to set 
connection properties only once in Torque. Other alternatives I have found are 
using a logon trigger (
e.g. 
http://forum.spring.io/forum/spring-projects/data/102188-best-way-to-set-nls-sort-for-oracle)
 or using Torque's support for case insensitive Queries 
(Criteria.setIgnoreCase).

Is the above acceptable for you?

> Not all DBCP properties are supported for connection pools
> ----------------------------------------------------------
>
>                 Key: TORQUE-340
>                 URL: https://issues.apache.org/jira/browse/TORQUE-340
>             Project: Torque
>          Issue Type: New Feature
>          Components: Runtime
>    Affects Versions: 4.0
>            Reporter: Rob Decker
>            Priority: Minor
>
> While the documentation for SharedPoolDataSourceFactory referes to the DBCP 
> documentation (http://commons.apache.org/dbcp/configuration.html) for 
> properties that can be set I tried to use connectionInitSqls (and the form 
> connectInitSqls) and it is not supported:
> Property: connectionInitSqls value: BEGIN;DBMS_SESSION.SET_NLS('NLS_COMP' is 
> not supported by DataSource: 
> org.apache.commons.dbcp.datasources.SharedPoolDataSource
> It would be nice if it supported this as it's a simple way to get 
> case-insensitive queries in Oracle. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org

Reply via email to