-->
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: Long activity best practice
PostPosted: Mon Jun 04, 2007 6:57 am 
Newbie

Joined: Mon May 14, 2007 10:38 am
Posts: 10
What is the best way to handle session in a long activity?

I have a scheduled application that need to read many entities (> 30000) and for each entity execute a quite complex calculation (reading children entities, updating data, ...).

Creating a single Session and Transaction seems to be too heavy (I think because the cache grows too much).

It is better to create a session/transaction for each entity?
Or maybe clearing and flushing the cache for each entity?

Thanks

Davide


Top
 Profile  
 
 Post subject: Re: Long activity best practice
PostPosted: Tue Jun 05, 2007 3:26 am 
Newbie

Joined: Thu May 03, 2007 2:30 am
Posts: 18
dvi2006 wrote:
What is the best way to handle session in a long activity?

I have a scheduled application that need to read many entities (> 30000) and for each entity execute a quite complex calculation (reading children entities, updating data, ...).

Creating a single Session and Transaction seems to be too heavy (I think because the cache grows too much).

It is better to create a session/transaction for each entity?
Or maybe clearing and flushing the cache for each entity?

Thanks

Davide


Hello...

Is there the option of moving this calculation into the Database? You could create a SP that will perform these operations and call it directly.This will allow you to skip NHiibernate completely and do the batch updates directly on the db. (Or scedule a job which will do the updates)


Top
 Profile  
 
 Post subject: Re: Long activity best practice
PostPosted: Tue Jun 05, 2007 3:38 am 
Newbie

Joined: Mon May 14, 2007 10:38 am
Posts: 10
rdrunner wrote:
Is there the option of moving this calculation into the Database?


Unfortunately it is a quite complex financial operation that requires to call external library for simulation and calculate risk values.

Anyway it is acceptable to have also 1 hour of activity, I only don't known what is the best way to use NHibernate in this case. Suggestions?

Davide


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 05, 2007 11:43 am 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
This was discussed recently here.


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.