Can not use Oracle connectionProperties in PoolingDataSource

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can not use Oracle connectionProperties in PoolingDataSource

Wim Goossens
this is what i want to set in the PoolingDataSource:
driverProperties.user=me
driverProperties.password=12345
driverProperties.URL=jdbc:oracle:thin:@xxxx.yyy.net:1521:ZZZ
driverProperties.connectionCachingEnabled=false
driverProperties.connectionProperties=oracle.jdbc.timezoneAsRegion=false;

It seems that the method setDriverProperties in bitronix.tm.resource.jdbc.PoolingDataSource only expects a properties file of type string string. (although it accepts any type of properties file)
If i want to set oracles connectionProperties  example connectionProperties=oracle.jdbc.timezoneAsRegion=false then i need to pass a properties file for connectionProperties.
I took a quick look and think that createXAFactory in bitronix.tm.resource.common.XAPool only handles driverProperties of type string string
This should also be string properties i think

Regards
Wim




Reply | Threaded
Open this post in threaded view
|

Re: Can not use Oracle connectionProperties in PoolingDataSource

Ludovic Orban-2
Try this instead:

driverProperties.user=me
driverProperties.password=12345
driverProperties.URL=jdbc:oracle:thin:@xxxx.yyy.net:1521:ZZZ
driverProperties.connectionCachingEnabled=false
driverProperties.connectionProperties.oracle.jdbc.timezoneAsRegion=false;

2011/7/7 Wim Goossens <[hidden email]>

this is what i want to set in the PoolingDataSource:
driverProperties.user=me
driverProperties.password=12345
driverProperties.URL=jdbc:oracle:thin:@xxxx.yyy.net:1521:ZZZ
driverProperties.connectionCachingEnabled=false
driverProperties.connectionProperties=oracle.jdbc.timezoneAsRegion=false;

It seems that the method setDriverProperties in
bitronix.tm.resource.jdbc.PoolingDataSource only expects a properties file
of type string string. (although it accepts any type of properties file)
If i want to set oracles connectionProperties  example
connectionProperties=oracle.jdbc.timezoneAsRegion=false then i need to pass
a properties file for connectionProperties.
I took a quick look and think that createXAFactory in
bitronix.tm.resource.common.XAPool only handles driverProperties of type
string string
This should also be string properties i think

Regards
Wim





--
View this message in context: http://old.nabble.com/Can-not-use-Oracle-connectionProperties-in-PoolingDataSource-tp32012190p32012190.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Can not use Oracle connectionProperties in PoolingDataSource

Wim Goossens
Ludovic,

This does not solve the problem.

But a small change in bitronix.tm.resource.common.XAPool does.


   private static Object createXAFactory(ResourceBean bean) throws Exception {
        String className = bean.getClassName();
        if (className == null)
            throw new IllegalArgumentException("className cannot be null");
        Class xaFactoryClass = ClassLoaderUtils.loadClass(className);
        Object xaFactory = xaFactoryClass.newInstance();

        Iterator it = bean.getDriverProperties().entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();
            String name = (String) entry.getKey();
            String value = (String) entry.getValue();

            if (name.endsWith(PASSWORD_PROPERTY_NAME)) {
                value = decrypt(value);
            }


            if (log.isDebugEnabled()) log.debug("setting vendor property '" + name + "' to '" + value + "'");
            PropertyUtils.setProperty(xaFactory, name, value);
        }
        return xaFactory;
    }


This should be changed to :

        private static Object createXAFactory(ResourceBean bean) throws Exception {
                String className = bean.getClassName();
                if (className == null)
                        throw new IllegalArgumentException("className cannot be null");
                Class xaFactoryClass = ClassLoaderUtils.loadClass(className);
                Object xaFactory = xaFactoryClass.newInstance();

                Iterator it = bean.getDriverProperties().entrySet().iterator();
                while (it.hasNext()) {
                        Map.Entry entry = (Map.Entry) it.next();
                        String name = (String) entry.getKey();
                        Object value = entry.getValue();

                        if (name.endsWith(PASSWORD_PROPERTY_NAME)) {
                                if (value instanceof String) {
                                        value = decrypt((String) value);
                                }
                        }


                        if (log.isDebugEnabled())
                                log.debug("setting vendor property '" + name + "' to '" + value
                                                + "'");
                        PropertyUtils.setProperty(xaFactory, name, value);
                }
                return xaFactory;
        }

Reason for the change is that the oracle driver needs a properties object for setting the connectionProperties

Regards
Wim

Ludovic Orban-2 wrote
Try this instead:

driverProperties.user=me
driverProperties.password=12345
driverProperties.URL=jdbc:oracle:thin:@xxxx.yyy.net:1521:ZZZ
driverProperties.connectionCachingEnabled=false
driverProperties.connectionProperties.oracle.jdbc.timezoneAsRegion=false;

2011/7/7 Wim Goossens <wg@cipal.be>

>
> this is what i want to set in the PoolingDataSource:
> driverProperties.user=me
> driverProperties.password=12345
> driverProperties.URL=jdbc:oracle:thin:@xxxx.yyy.net:1521:ZZZ
> driverProperties.connectionCachingEnabled=false
> driverProperties.connectionProperties=oracle.jdbc.timezoneAsRegion=false;
>
> It seems that the method setDriverProperties in
> bitronix.tm.resource.jdbc.PoolingDataSource only expects a properties file
> of type string string. (although it accepts any type of properties file)
> If i want to set oracles connectionProperties  example
> connectionProperties=oracle.jdbc.timezoneAsRegion=false then i need to pass
> a properties file for connectionProperties.
> I took a quick look and think that createXAFactory in
> bitronix.tm.resource.common.XAPool only handles driverProperties of type
> string string
> This should also be string properties i think
>
> Regards
> Wim
>
>
>
>
>
> --
> View this message in context:
> http://old.nabble.com/Can-not-use-Oracle-connectionProperties-in-PoolingDataSource-tp32012190p32012190.html
> Sent from the Bitronix Transaction Manager mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can not use Oracle connectionProperties in PoolingDataSource

Ludovic Orban-2
Wim,

Sorry for the delay answering you back.

Can you please open a new JIRA issue to make sure that will be included in further releases?


Thanks!
Ludovic



2011/7/13 Wim Goossens <[hidden email]>

Ludovic,

This does not solve the problem.

But a small change in bitronix.tm.resource.common.XAPool does.


  private static Object createXAFactory(ResourceBean bean) throws Exception
{
       String className = bean.getClassName();
       if (className == null)
           throw new IllegalArgumentException("className cannot be null");
       Class xaFactoryClass = ClassLoaderUtils.loadClass(className);
       Object xaFactory = xaFactoryClass.newInstance();

       Iterator it = bean.getDriverProperties().entrySet().iterator();
       while (it.hasNext()) {
           Map.Entry entry = (Map.Entry) it.next();
           String name = (String) entry.getKey();
           String value = (String) entry.getValue();

           if (name.endsWith(PASSWORD_PROPERTY_NAME)) {
               value = decrypt(value);
           }

           if (log.isDebugEnabled()) log.debug("setting vendor property '"
+ name + "' to '" + value + "'");
           PropertyUtils.setProperty(xaFactory, name, value);
       }
       return xaFactory;
   }


This should be changed to :

       private static Object createXAFactory(ResourceBean bean) throws Exception {
               String className = bean.getClassName();
               if (className == null)
                       throw new IllegalArgumentException("className cannot be null");
               Class xaFactoryClass = ClassLoaderUtils.loadClass(className);
               Object xaFactory = xaFactoryClass.newInstance();

               Iterator it = bean.getDriverProperties().entrySet().iterator();
               while (it.hasNext()) {
                       Map.Entry entry = (Map.Entry) it.next();
                       String name = (String) entry.getKey();
                       Object value = entry.getValue();

                       if (name.endsWith(PASSWORD_PROPERTY_NAME)) {
                               if (value instanceof String) {
                                       value = decrypt((String) value);
                               }
                       }

                       if (log.isDebugEnabled())
                               log.debug("setting vendor property '" + name + "' to '" + value
                                               + "'");
                       PropertyUtils.setProperty(xaFactory, name, value);
               }
               return xaFactory;
       }

Reason for the change is that the oracle driver needs a properties object
for setting the connectionProperties

Regards
Wim


Ludovic Orban-2 wrote:
>
> Try this instead:
>
> driverProperties.user=me
> driverProperties.password=12345
> driverProperties.URL=jdbc:oracle:thin:@xxxx.yyy.net:1521:ZZZ
> driverProperties.connectionCachingEnabled=false
> driverProperties.connectionProperties.oracle.jdbc.timezoneAsRegion=false;
>
> 2011/7/7 Wim Goossens <[hidden email]>
>
>>
>> this is what i want to set in the PoolingDataSource:
>> driverProperties.user=me
>> driverProperties.password=12345
>> driverProperties.URL=jdbc:oracle:thin:@xxxx.yyy.net:1521:ZZZ
>> driverProperties.connectionCachingEnabled=false
>> driverProperties.connectionProperties=oracle.jdbc.timezoneAsRegion=false;
>>
>> It seems that the method setDriverProperties in
>> bitronix.tm.resource.jdbc.PoolingDataSource only expects a properties
>> file
>> of type string string. (although it accepts any type of properties file)
>> If i want to set oracles connectionProperties  example
>> connectionProperties=oracle.jdbc.timezoneAsRegion=false then i need to
>> pass
>> a properties file for connectionProperties.
>> I took a quick look and think that createXAFactory in
>> bitronix.tm.resource.common.XAPool only handles driverProperties of type
>> string string
>> This should also be string properties i think
>>
>> Regards
>> Wim
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Can-not-use-Oracle-connectionProperties-in-PoolingDataSource-tp32012190p32012190.html
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://old.nabble.com/Can-not-use-Oracle-connectionProperties-in-PoolingDataSource-tp32012190p32052542.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email