-->
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.  [ 1 post ] 
Author Message
 Post subject: Session.connection() vs DBUtil.getConnection()
PostPosted: Fri Jun 30, 2006 9:26 am 
Beginner
Beginner

Joined: Wed Jun 21, 2006 10:08 am
Posts: 26
Hibernate version: 3

Are there any known reason not to use hibernate's framework to obtain the JDBC Connection?

The issue is:
We have a large scale web app and are slowly migrating parts of it to start using Hibernate. There is a lot of custom SQL written and we already have a pooling solution in place.

Is it bad practice to do:

Session s = SessionFactory.getSession();
Connection c = s.Connection();
PreparedStatement ps = c.prepareStatement(CustomSQL);
ps.execute;
s.close();

In my research I plan on doing some tests to see the times it takes to execute some queries through the 2 different methods. I'll post those results here. I was just wondering if someone out there knew better already.

Thanks in advance.
- Jonathan

_________________
- Jonathan


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

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.