You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Chua Chee Seng <ch...@gmail.com> on 2007/09/26 10:48:35 UTC

Transaction problem using Spring 2 Transaction + Oracle Data Source

Hi all,

I am facing problem when using Spring 2 Transaction with Oracle Data Source. 
The following are the version of components that I am using:-

i)   JDK (Sun 1.6.0_02)
ii)  Geronimo 1.1.1
iii)   spring.jar (version 2.0.6)
iv)  aspectweaver.jar, commons-dbcp.jar, commons-logging.jar,
commons-pool.jar (come with spring distribution)
v) ojdbc6.jar (Downloaded from Oracle 11g database driver)

I have deployed a Oracle Data Source called 'TestDataSource' using Console. 
I then deployed the testoracle application which contains a TestBean.  The
TestBean contains a insertData() method which uses Spring JDBC to write a
record into 'kz_id' database table.  The 'kz_id' table has two columns
called 'id' (varchar2 type) and 'current_value' (number).  Spring
Declarative transaction management is used to commit/rollback the
transaction.  TestServlet get the TestBean from the Spring context and call
the insertData() method.  I have enabled the logging to see what Spring does
with the transaction.

Once TestServlet is accessed, I can see from the log that Spring is starting
the transaction and commit it when it is done.  It seems to have committed
successfully.  But I am not able to see the data from other Oracle client,
for example using sqlplus.  To double comfirm that the transaction is not
committed properly, I tried to update the related row, which it hang.  I
also query the v$transaction view and see 1 increment after the TestServlet
is accessed.  Once Geronimo is shutdown, the data is visible to other
clients and count in v$transaction is decreased.

I first think it is the problem of the Oracle driver, however, if I use
apache DBCP's BasicDataSource instead of data source managed by Geronimo, it
works fine!  This makes me wonder whether the problem can come from tranql
or Geronimo data source?

Honestly, I do not know the cause,  I would really appreciate for any helps
to clarify this.

I attach the web app for your reference.

http://www.nabble.com/file/p12896626/testoracle.zip testoracle.zip 

Thanks.

Best Regards,
Chee Seng

-- 
View this message in context: http://www.nabble.com/Transaction-problem-using-Spring-2-Transaction-%2B-Oracle-Data-Source-tf4520875s134.html#a12896626
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Transaction problem using Spring 2 Transaction + Oracle Data Source

Posted by Chua Chee Seng <ch...@gmail.com>.
Hi all,

Lucky enough to find a solution at IBM site:-

http://www.ibm.com/developerworks/forums/dw_thread.jsp?message=13966649&cat=51&thread=166688&treeDisplayType=threadmode1&forum=541#13966649 

I am sorry for wasting a post.  Thanks.

Best Regards,
Chee Seng



Chua Chee Seng wrote:
> 
> Hi all,
> 
> I am facing problem when using Spring 2 Transaction with Oracle Data
> Source.  The following are the version of components that I am using:-
> 
> i)   JDK (Sun 1.6.0_02)
> ii)  Geronimo 1.1.1
> iii)   spring.jar (version 2.0.6)
> iv)  aspectweaver.jar, commons-dbcp.jar, commons-logging.jar,
> commons-pool.jar (come with spring distribution)
> v) ojdbc6.jar (Downloaded from Oracle 11g database driver)
> 
> I have deployed a Oracle Data Source called 'TestDataSource' using
> Console.  I then deployed the testoracle application which contains a
> TestBean.  The TestBean contains a insertData() method which uses Spring
> JDBC to write a record into 'kz_id' database table.  The 'kz_id' table has
> two columns called 'id' (varchar2 type) and 'current_value' (number). 
> Spring Declarative transaction management is used to commit/rollback the
> transaction.  TestServlet get the TestBean from the Spring context and
> call the insertData() method.  I have enabled the logging to see what
> Spring does with the transaction.
> 
> Once TestServlet is accessed, I can see from the log that Spring is
> starting the transaction and commit it when it is done.  It seems to have
> committed successfully.  But I am not able to see the data from other
> Oracle client, for example using sqlplus.  To double comfirm that the
> transaction is not committed properly, I tried to update the related row,
> which it hang.  I also query the v$transaction view and see 1 increment
> after the TestServlet is accessed.  Once Geronimo is shutdown, the data is
> visible to other clients and count in v$transaction is decreased.
> 
> I first think it is the problem of the Oracle driver, however, if I use
> apache DBCP's BasicDataSource instead of data source managed by Geronimo,
> it works fine!  This makes me wonder whether the problem can come from
> tranql or Geronimo data source?
> 
> Honestly, I do not know the cause,  I would really appreciate for any
> helps to clarify this.
> 
> I attach the web app for your reference.
> 
>  http://www.nabble.com/file/p12896626/testoracle.zip testoracle.zip 
> 
> Thanks.
> 
> Best Regards,
> Chee Seng
> 
> 

-- 
View this message in context: http://www.nabble.com/Transaction-problem-using-Spring-2-Transaction-%2B-Oracle-Data-Source-tf4520875s134.html#a12898237
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.