Re: Illegal Lock usage
Re: Illegal Lock usage
- Subject: Re: Illegal Lock usage
- From: Chuck Hill <email@hidden>
- Date: Wed, 6 Feb 2008 10:15:01 -0800
On Feb 6, 2008, at 1:54 AM, Frank Stock wrote:
I don't use the EC from the session, I use a new EC in the thread.
But I need to import a lot of records so I need to clean from to
to time, or I risk an out of memory:
if(rowcount00==0)
{
System.out.println(rowcount);
ec.saveChanges();
ec.rootObjectStore().invalidateAllObjects();
}
That is not a good way of managing memory usage. See these links for
some ideas:
http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-Memory
+Management
http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-Bulk
+Operations
You want to dispose the EC and create a new one. Calling
ec.invalidateAllObjects(); or ec.rootObjectStore
().invalidateAllObjects(); is to be avoided.
That said, this does not explain the lock errors below. Where does
ec come from?
Chuck
Frank Stock
Belgium
Op 5-feb-08, om 17:28 heeft Chuck Hill het volgende geschreven:
You are implementing it wrong. I am guessing that you are using
an EC from the session in the long response page. The thread
needs its own EC that it locks and unlocks.
Chuck
On Feb 5, 2008, at 12:52 AM, Frank Stock wrote:
HI,
I am writing an application to update Frontbase from FileMaker.
I use AjaxLongResponse in my interface to see the progress in the
browser.
But I always get an error:
<er.ajax.AjaxRequestHandler>: Exception occurred while handling
request:
java.lang.IllegalStateException: Illegal Lock usage: unlocking
thread not owner.
[2008-02-04 19:25:12 CET] <WorkerThread0>
java.lang.IllegalStateException: Illegal Lock usage: unlocking
thread not owner.
at com.webobjects.foundation.NSRecursiveLock.unlock
(NSRecursiveLock.java:207)
at com.webobjects.eocontrol.EOEditingContext.unlock
(EOEditingContext.java:4720)
at er.extensions.ERXEC.unlock(ERXEC.java:455)
at com.webobjects.appserver.WOSession._sleepInContext
(WOSession.java:736)
at com.webobjects.appserver.WOApplication.saveSessionForContext
(WOApplication.java:1514)
at er.extensions.ERXApplication.saveSessionForContext
(ERXApplication.java:1665)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatc
hWithPreparedApplication(WOComponentRequestHandler.java:329)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleR
equest(WOComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleRe
quest(WOComponentRequestHandler.java:435)
at er.ajax.AjaxRequestHandler.handleRequest
(AjaxRequestHandler.java:17)
at com.webobjects.appserver.WOApplication.dispatchRequest
(WOApplication.java:1306)
at er.extensions.ERXApplication.dispatchRequest
(ERXApplication.java:1398)
at Application.dispatchRequest(Application.java:56)
at com.webobjects.appserver._private.WOWorkerThread.runOnce
(WOWorkerThread.java:173)
at com.webobjects.appserver._private.WOWorkerThread.run
(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
Is there a way to avoid this? Or am I impplementing this wrong?
I can see also next error):
Another Exception occurred while trying to clean the application:
java.lang.IllegalStateException: Illegal Lock usage: unlocking
thread not owner.
[2008-02-04 19:25:12 CET] <WorkerThread0>
java.lang.IllegalStateException: Illegal Lock usage: unlocking
thread not owner.
at com.webobjects.foundation.NSRecursiveLock.unlock
(NSRecursiveLock.java:207)
at com.webobjects.eocontrol.EOEditingContext.unlock
(EOEditingContext.java:4720)
at er.extensions.ERXEC.unlock(ERXEC.java:455)
at com.webobjects.appserver.WOSession._sleepInContext
(WOSession.java:736)
at com.webobjects.appserver.WOApplication.saveSessionForContext
(WOApplication.java:1514)
at er.extensions.ERXApplication.saveSessionForContext
(ERXApplication.java:1665)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleR
equest(WOComponentRequestHandler.java:385)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleRe
quest(WOComponentRequestHandler.java:435)
at er.ajax.AjaxRequestHandler.handleRequest
(AjaxRequestHandler.java:17)
at com.webobjects.appserver.WOApplication.dispatchRequest
(WOApplication.java:1306)
at er.extensions.ERXApplication.dispatchRequest
(ERXApplication.java:1398)
at Application.dispatchRequest(Application.java:56)
at com.webobjects.appserver._private.WOWorkerThread.runOnce
(WOWorkerThread.java:173)
at com.webobjects.appserver._private.WOWorkerThread.run
(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
Thanks for helping,
Frank Stock
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
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
--
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden