On 07-03-13, at 13:04, Chuck Hill wrote:


On Mar 13, 2007, at 9:56 AM, Jacky Gagnon wrote:

Hi,

I have this very cool exception who will drive me crazy :

"java.lang.IllegalStateException: rowDiffsForAttributes: snapshot in com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {}; ..."


The problem happen when I try to edit an object with an assistant :

a) That is not the problem, that is only the symptom of the problem.
b) There is only one cause of this exception, which I proved on this list a couple of weeks back when it happened to me.

Somewhere, perhaps far away from this, you are doing bad things to EOF. If you stop doing that, this exception will stop happening. You are doing something wrong in one or both of these areas:

http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ The_EOF_Commandments http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ Context_and_Database_Locking

The first thing I would do is to enable DebugGroupMultithreading and run your app. Check the log and fix anything it complains about.

Chuck


Thanks! Chuck...

The problem was in my direct action where I tried to lock my nested EC without calling generateResponse() before unlocking; what I'm not sure is why the DebugGroupMultithreading didn't alert me (because it was already enable)?

public WOActionResults startTheAssistant() {
   WOComponent pageAssistant = pageWithName("FirstPageForMyAssistant");
   WOResponse response;
   session().myNestedEC().lock;
   try {
   ...
       response = pageAssistant.generateResponse().
   } finally {
       session().myNestedEC().unlock;
   }
   return response;
 }





- In a direct action I create a session, fetch the object into the default editing context and I transfert it to a nested editing context with «localInstanceOfObject» and I go to the first page of my assistant where the user can edit the object. (I use the MultiECLockManager to lock my nestedEC).

-In the end, I save my nestedEC and the defaultEC, and I get the java.lang.IllegalStateException... !


I did a unit test to simulate the edition of the object made by the assistant, and all run fine.

The problem seem to happen when I go to the next component (direct action to a regular component?).

My question is, what the best way to diagnose this problem?


Thanks!

Note : I didn't have exception about an object trying to access an unlocked EC and "EOObjectsChangedInStoreNotification" is only call when I try to save my changes.





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to