geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: How can I set ExceptionSorterClass property for my database pool?
Date Tue, 29 Apr 2008 16:52:29 GMT

On Apr 29, 2008, at 3:38 AM, Sara T wrote:

> Thank you very much for your answer.
> I've got another question, to understand how exception transaction
> management works: why does ra.xml set ExceptionSorterClass property as
> org.tranql.connector.AllExceptionsAreFatalSorter by default in
> tranql-connector-ra-1.3.rar?
> This is my situation: my database is Oracle Thin type, so if I  
> deploy it
> using Geronimo console, TranQL Generic JDBC Resource Adapter is used  
> for the
> pool.

I'm not exactly an oracle expert.  Is there some reason you don't use  
the oracle specific tranql wrapper?
> There’s a problem with my application when, for exemple, there are two
> update instructions in one transaction and the second one catches an
> SQLException (ex: invalid sql).
> In this case the second update isn’t committed, but the first one is.
> I think (but it’s true?) that is because connectionError method in
> org.tranql.connector.AbstractManagedConnection checks if  
> exceptionSorter is
> fatal.
> In this case connection is returned and cleanup method in
> org.tranql.connector.jdbc.ManagedJDBCConnection class is called: in  
> this
> method  physical connection is committed  (setAutoCommit(true)).
> Otherwise (if exceptionSorter isn’t fatal) I could catch it in my
> application and call rollback for the connection before that clean  
> method is
> called.

This doesn't sound right.  You should still get transactional  
behavior, i.e. neither update should be committed if you are really in  
a transaction and the second update causes an exception.  The behavior  
you describe should only happen if there is no jta transaction  
containing both updates.  How are transactions controlled in your app?

> Do you think that this could be my case?
> Is it right to set ExceptionSorterClass property as
> org.tranql.connector.NoExceptionsAreFatalSorter  to call rollback  
> from my
> application in exception case (and so deploy my database manually
> using a deployment plan, as you said in your previous answer) ?

This should work for your situation.  The problem is that if a real  
fatal connection error occurs (such as the tcp connection to the  
database going down) the connector framework will not be able to clean  
up the connections and you will have to wait for them to all time out.
> Is there any way to do it using Geronimo console?

I don't see a way to set the sorter using the console.  I'm not sure  
why this is left out.

I'm most concerned about the commit of the first update when the  
second throws an exception.

david jencks

> Thanks for your time!
> Sara
> djencks wrote:
>> On Apr 23, 2008, at 7:43 AM, Sara T wrote:
>>> Hi all,
>>> I’m new with Geronimo and I need your help to configure my database
>>> pool.
>>> In particular I’ve seen that if deploy database pool through the
>>> Geronimo
>>> console, by default ExceptionSorterClass property is set as
>>> org.tranql.connector.AllExceptionsAreFatalSorter: I need to change
>>> it in
>>> org.tranql.connector.NoExceptionsAreFatalSorter.
>>> Which is the best way to do that?
>> The very best way to do this is to write a database-specific wrapper,
>> such as tranql has for derby, db2, postgres, mysql, and oracle.  Many
>> databases have XADatasources or PooledDataSources that already notify
>> the environment in case of a fatal connection error, and using one of
>> these avoids the obvious problems with both provided exception  
>> sorters.
>>> Should I change it in
>>> tranql-connector-ra-1.3.rar\META-INF\ra.xml file and then use  
>>> Geronimo
>>> database pool wizard or create my plan and deploy the pool via the
>>> command-line deploy tool?
>>> In this second case what happens if, after the deploy, I change  
>>> other
>>> properties using the Geronimo console? ExceptionSorterClass property
>>> can be
>>> overwritten with the default value? (I don’t know where pool
>>> properties are
>>> saved).
>> You should set the class in your geronimo plan. After deployment the
>> new value will not be overwritten by changes you make though the
>> console.
>> Let us know if you have further problems
>> thanks
>> david jencks
>>> Thanks and sorry for my english!
>>> Sara
>>> -- 
>>> View this message in context:
>>> Sent from the Apache Geronimo - Users mailing list archive at
> -- 
> View this message in context:
> Sent from the Apache Geronimo - Users mailing list archive at  

View raw message