-->
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.  [ 3 posts ] 
Author Message
 Post subject: MSSQL 2005 Performance Problem because of Prepared Statement
PostPosted: Tue Nov 11, 2008 9:21 am 
Newbie

Joined: Tue Nov 11, 2008 7:22 am
Posts: 1
I have a Problem with an old (1.1 patched) version of Hibernate and ran into an boring performance Problem on a Live server of a customer.

I have on Use Case where hibernate makes about 5000 select calls to a mssql server, these are executed with sp_prepare and sp_execute

the performance is horrible because the mssql server 2005 doesnt understand that a select in a sp_execute needs not transaction and logs all the select statements in the transaction log (if logging is set to full)

The performance is poor because of the massive data wich gets written to mssql's transaction log (processor and ram is doing nothing noticeable)
but the log file gets blewn up by 1,5gb in a few minutes.

Does someone had the same problem.

Is there a way to tell either mssql server not to log sp_executes when they contain selects?
or tell hibernate not to use prepared statements (probably makes the rest of the system slow?)?

regards sebastian


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2009 4:43 pm 
Beginner
Beginner

Joined: Wed Aug 27, 2003 3:54 am
Posts: 28
Dis you find a solution for this problem ?


Top
 Profile  
 
 Post subject: fix is with the SQL server 2005
PostPosted: Wed Jan 14, 2009 12:42 pm 
Regular
Regular

Joined: Mon Jan 05, 2009 6:42 pm
Posts: 99
Location: IL
Hi Sebastian,
we ran into the issue when we had long transactions and the SQL server 2005 transaction log blew to a big number.

From Java Side, if you can make changes then try to have smaller transactions.

From SQL server 2005 taking frequent database backups will clean up (I guess truncate is the term)the transaction log.
Also for the transaction log increase the initial size to a big number for example 1 Gig and enable autogrowth in big numbers of Mega bytes.
and let your application run and see how the transaction log fills up and repeat the process and keep increasing the initial size and the autogrowth until you see the transaction log being stable.

your database administrator might know about this. Or just google on setting the SQL server 2005 transaction log you will find many articles and they explain how the transaction log works and how to optimize and set the log size etc..

The way we resolved our issue is that we changed our product to have smaller transactions and took back ups of the database frequently. Also we did play around with the transaction log size setting but did not move these changes to production because those changes were not necessary.

The reason why SQL Selects are part of the transaction logs is because they are part of the transaction.(I know it does not make any sense to have Selects but i guess that's the reason.)

Please post if you have resolved and how. Just curious.
-Srilatha.


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