-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate in batch programs..
PostPosted: Fri May 25, 2007 9:40 am 
Newbie

Joined: Sun Jul 23, 2006 3:08 pm
Posts: 4
Hi,
I'm exploring to use Hibernate in our Java batch programs. The quesiton i have is did someone have used this? If YES, was it worth doing it. Did the performance improved or went bad. If anyone can give me answers and other useful info to use Hibernate with java batch progams it will be very useful.

Thanks,
Senthil.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 25, 2007 11:00 am 
Newbie

Joined: Thu Jul 13, 2006 10:48 am
Posts: 2
Hi,

Take a look at the StatelessSession. This is a special Hibernate Session which has a lot less overhead at the cost of much reduced functionality. But this is usually functionality which you don't need or can program yourself in a batch operation.

Actually there is a whole chapter in the reference manual:

http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#batch

I have been programming batch with Hibernate myself and at that time I dind't know about the stateless session. I had to fall back on JDBC with a session.connection() in order to get the performance I wanted.

Some other tips concering batch operations:
1) Evict objects you don't need from your Session or else you will run into memory problems.
2) Commit in batches. Don't save up you're entier batch up till the end but don't commit after every insert either.[/url]


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 8:10 pm 
Newbie

Joined: Sun Jul 23, 2006 3:08 pm
Posts: 4
Hi,
Sorry...i guess i didn't ask my question correctly. What i meant was, I would like to use the Hibernate in the Java Programs which will be invoked using the Unix Shell Scripts. We have Java programs which at the end of the day / week / month does table back-up, report creation, etc., So for these types of work can i use Hibernate.

Senthil.


Top
 Profile  
 
 Post subject: Similar problem: batch programs and hibernate
PostPosted: Sun Jan 20, 2008 12:04 am 
Newbie

Joined: Sat Jan 19, 2008 1:27 am
Posts: 2
senthilnathan74 wrote:
Hi,
I am also trying similar thing. I am using running batch jobs with a direct connection for now. But now, I am thinking of using hibernate also. WIll it be a good venture.
Senthil.
Quote:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.