You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by shannu1315 <sh...@virtusa.com> on 2009/10/07 10:45:01 UTC

Re: Looking for advice on JPA based DAO


Hi Wes,

I am working Jpa Toplink using spring, I have one req for batchupdate, for
this batchupdate i am using the preparedstatement, for this i need the
connection. with out spring its working fine but while integrating with this
connection coming null.

pstmt1 = connection.prepareStatement(query);

connection = ((oracle.toplink.essentials.ejb.cmp3.EntityManager)
entityManager)
					.getServerSession().getDefaultConnectionPool()
					.acquireConnection().getConnection();

this connection coming null, with out spring this connection working fine.

So please provide the solution for fetching the connection.





Wes Wannemacher wrote:
> 
> 
>> Daniel
> 
> Personally, I like Spring. It is mostly inobtrusive and easy to unit test.
> I 
> have a GenericDao I wrote and reuse. It is tied to Spring's JpaTemplate
> and 
> DaoSupport, but it's easy and works great. If you want it, ping me
> off-list, 
> and I'll send it over with an example spring config (with pooling 
> connections).
> 
> -Wes
> 
> -- 
> 
> Wes Wannemacher
> Author - Struts 2 In Practice 
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Looking-for-advice-on-JPA-based-DAO-tp2641707p3780492.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.