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
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
--- 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
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
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
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();
}
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
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