Re: WOLongResponse and EO processing
Re: WOLongResponse and EO processing
- Subject: Re: WOLongResponse and EO processing
- From: "Richard Bruch" <email@hidden>
- Date: Wed, 11 Aug 2004 23:28:13 +0200
Hi Allen,
now i better understand what you mean. Yes they definitely share a transaction
because a connection can have only one active transaction at a time. But
actually even with separate coordinator stacks(database connections) different
threads can affect each other. Oracle by default uses the so called "read
commited" mode which means a query can see changes which were caused by a
transaction finished before the query execution began, which again means that
within the same transaction two identical queries can return different
results, if another transaction has taken place in between. I suppose that
Frontbase uses that mode too. In a shared resource like a database it is
impossible to serialize everything without severe performance hits. The
crucial point is to avoid data inconsistencies.
Does your example cause any inconsistency in the database or in the EO layer ?
I mean not. Queries don't affect each other, the insert operation is the last
in the transaction so it cannot affect anything. Then the next transaction
begins and the story repeats itself. Changes made in the EC of the thread A
however would affect the EC of the thread B even before being written back to
the DB because they share the objects snapshots and are synchronized by means
of internal notifications. So this kind of "collision" is not even an SQL
issue although this could be a motivation to use separate coordinator
stacks(different snapshots)
In other words i mean you cannot make things any "worse" than they are just
by using threads instead of many simultaneous sessions executed by the same
thread - because of the shared nature of an object store coordinator and the
effect is the same.
Surely, i am not necessarily fully aware of problems you confront with so
let's consider a more dangerous example to see what could be done there.
Richard
----- Original Message -----
From: Allen Cronce
To: Richard Bruch
Cc: email@hidden ; email@hidden ;
email@hidden
Sent: Wednesday, August 11, 2004 8:35 PM
Subject: Re: WOLongResponse and EO processing
Hi Richard,
What we did to diagnose this problem was look at the FrontBase SQL transaction
log, which includes all the SQL to the database and the results. When
compared to our application log information, it certainly looks like we are
seeing an unintentional merge of SQL from multiple threads in a single
transaction.
Here's an example of what we are seeing (with the details removed):
Select from thread A (from a request/response loop)
Select from thread B (from the WOTimer thread)
Select from thread B
Insert from thread A
Commit
I won't go into details as to the tables and errors because I don't think that
level of detail is useful for this discussion. Needless to say when the above
happens, all hell breaks loose.
I guess it's possible that we've misinterpreted this information, but I don't
think so. It really looks like when two threads (one from a request/response
loop and the other from a timer) are sharing a connection to the database,
there is a non-zero probability that they will also share a transaction.
Best regards,
Allen Cronce
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.