[Hibernate] bad performance during flush and help is needed.

2003-09-11 Thread jiesheng zhang
My system is a prototype system. There is only one test user at any time. For this user, there is about 500-600 objects loaded in the Hibernate session at maximal. Very often, my application needs to change only one field in one object and commit the transaction. My code is like this Tranactio

Re: [Hibernate] bad performance during flush and help is needed.

2003-09-11 Thread Gavin King
the transaction. My code is like this Tranaction tx=sessiob.beginTransaction(); foo.setField(newValue); tx.commit(); Well, obviously it is not like that, since that code does not load any objects into the session. 1. When the commit() is called, will the hibernate loop through every object in the

Re: [Hibernate] bad performance during flush and help is needed.

2003-09-12 Thread jiesheng zhang
--- Gavin King <[EMAIL PROTECTED]> wrote: > So, let me get this straight: > > you, *500 times* > > (a) obtain a new JDBC connection > (b) start a transaction > (c) do some work > (d) commit the transaction and close the JDBC > connection Not quite that. I, *500 times* (a') using the same connec

Re: [Hibernate] bad performance during flush and help is needed.

2003-09-12 Thread Gavin King
So, let me get this straight: you, *500 times* (a) obtain a new JDBC connection (b) start a transaction (c) do some work (d) commit the transaction and close the JDBC connection and you are surprised that this is slow?? Why would you not do it all in one transaction? Starting and stopping trans

Re: [Hibernate] bad performance during flush and help is needed.

2003-09-12 Thread Josh Rehman
jiesheng zhang wrote: > Forget about the 500 transactions. The problem is > this: with 300-500 objects in the session cache, a > single transaction( with an single object inserted) > takes about one second. How long does a single transaction take in raw JDBC? I agree with Gavin's implicit suggesti

Re: [Hibernate] bad performance during flush and help is needed.

2003-09-12 Thread jiesheng zhang
First I have a source class like this. public class Source { Transaction tx; List pendingRemovedItems; public void beginTransaction() { // here I use ThreadLocal pattern. tx= ThreadState.getSession().beginTransaction(); }

Re: [Hibernate] bad performance during flush and help is needed.

2003-09-12 Thread Gavin King
Forget about the 500 transactions. The problem is this: with 300-500 objects in the session cache, a single transaction( with an single object inserted) takes about one second. It simply does *not* take a second to dirty check 500 objects, dude. Nowhere even close. If you think you can prove that

Re: [Hibernate] bad performance during flush and help is needed.

2003-09-13 Thread Patrick Burleson
At 08:15 PM 9/12/2003 +1000, Gavin King wrote: Forget about the 500 transactions. The problem is this: with 300-500 objects in the session cache, a single transaction( with an single object inserted) takes about one second. It simply does *not* take a second to dirty check 500 objects, dude. Nowh