Article "Using Oracle TopLink with the Spring Framework" published on OTN

Today the Oracle Technology Network published my article Using Oracle TopLink with the Spring Framework. In this article I explain step by step how to build a sample application using Spring 1.2.8 and Oracle TopLink with Oracle JDeveloper 10g.

JDeveloper has built in support for TopLink, but you can build the sample application with Eclipse as well. Download the sources and follow the steps in the article. Instead of editing the TopLink sessions in JDeveloper, edit the xml files in the Eclipse editor or the TopLink workbench.

Comments (2)

  1. Maarten Winkels - Reply

    September 27, 2006 at 10:39 am

    Lonneke,

    Interesting!
    One remark: I couldn't find the calls to setComplete and endTransaction that you refer to in the article in the source code attached. I was triggered to look for these methods, because in our project we do not use this technique. With Spring managed transactions you can make the JdbcTemplate and the Dao's share the same transaction, this works for Hibernate, does it for TopLink? See Spring's TransactionAwareDataSourceProxy and setUseTransactionAwareDataSource methods.

    Regards,

    -Maarten Winkels

  2. Lonneke Dikmans - Reply

    September 27, 2006 at 8:06 pm

    Thanks for the observation: it seems that the wrong version of the sample application was put on the website. It has been corrected, please try and download the sources again.

    To answer your question: sharing the transaction between a jdbcTemplate and TopLinkDAO should work fine. In my example I don't have any transactions in my unittest configuration. The AbstractTransactionalDataSourceSpringContextTests takes care of the transactions in the testcases. That gives you a hook to test the behaviour of the DAO's when certain situations occur. For example the unexpected ending of a transaction...

Add a Comment