-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: JasperReports, DBCP, Access to underlying connection
PostPosted: Tue Mar 29, 2005 11:32 am 
Newbie

Joined: Sat Jan 08, 2005 3:40 pm
Posts: 7
Location: New York
I'm using JasperReports and would like to hand a connection off that I obtain from Hibernate's DBCP connection pool.

Using...

Code:
Connection connection = sessionFactory.openSession().connection();

...I find that what I get is not a java.sql.Connection that Jasper can deal with but rather a org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

Searching around I found that there is a way to get at the underlying connection by setting a preference...

Code:
PoolingDriver.setAccessToUnderlyingConnectionAllowed(true);

The problem is that Hibernate is handling the DBCP connection pool, so I need to somehow set this flag via Hibernate's properties file. Something like...

Code:
hibernate.dbcp.setAccessToUnderlyingConnectionAllowed true

...only this didn't work. Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 4:36 pm 
Newbie

Joined: Sat Jan 08, 2005 3:40 pm
Posts: 7
Location: New York
Well the "solution" I came up with was to relieve Hibernate of it's connection pool responsibilities. Instead I've set up DBCP independently and provide Hibernate with connections as needed. Probably better this way in any case.

-S


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.