-->
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: Performance Issues
PostPosted: Fri Aug 06, 2010 5:47 pm 
Newbie

Joined: Fri Aug 06, 2010 5:25 pm
Posts: 1
Hello that such:

I have the following case,

I do a query to the table1 and gives me 41 data stored in a List1

Iterate list1 to make another query to table2 and 23 994 data stored in a List2

Iterate list2 and for each record that meets certain conditions you do your Session.save

I can not have a single query in both general and conditions that need to happen to come from my gui

after all validations then I do the commit

protected void saveStatus (String status, Session sess)
(
Transaction tx = null;
try
(
tx = sess.getTransaction ();
tx.begin ();
processStatus.setStatus (status);
processStatus.setEndProcess (new Date ());
sess.saveOrUpdate (ProcessStatus)
tx.commit ();
)
catch (Exception ex)
(
if (tx! = null & & tx.isActive ())
tx.rollback ();
)
)

as I can improve my performance? and is very slow and takes days


Top
 Profile  
 
 Post subject: Re: Performance Issues
PostPosted: Mon Aug 09, 2010 6:40 am 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
Hi cogitoergo9,

If you give a clear picture of the table design and business requirement, it is useful to resolve the issue soon. You have some requirement such that you query and the list goes like subquery. Subquery always degrade performance. Make sure when loading the objects you use load() instead of get() method.

First you do select query you do some business validation then save. What is the base table and where your query map to business validations.

Hope you will provide more information

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


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.