RE: While The Database Searches...
RE: While The Database Searches...
- Subject: RE: While The Database Searches...
- From: "Pierre Bernard" <email@hidden>
- Date: Fri, 6 Dec 2002 09:09:41 +0100
- Thread-topic: While The Database Searches...
Indeed, I was using the long response page to do some heavy
computations and not to fetch data.
With WebObjects 5.2 where the EOs hold strong references to their
context you could pass the retrieved EOs on to the next page for
displaying without them ever being copied into the session's default
context. Actually I would recommend using the default editing context
as little as possible. However you would be from there on responsible
of locking and unlocking that context.
You can actually to the same thing in previous versions of WO 5.x but
you would have to pass both the EOs and the EC.
Doing so should be possible with an appropriate locking strategy. Read:
I did not try it myself. The default EC is locked and unlocked
automatically as the session awakes and sleeps. While the code you put
into the long response page's performAction method is executed in a
separate thread, the page peridically refreshes in the default thread.
The user may also chose to surf away to different pages. Every time a
page is loaded, the lock on the default context needs to be obtained.
Thus performAction should not hold onto it for a long period of time.
Unless there is a way to split the long fetch into several shorter ones
I indeed don't see any way how to periodically and temporarily release
the lock for other threads to get a chance at aquiring it.
Faulting the EOs into the default editing context should be possible
without additional database access. You would need to access the default
EC only onceand for a shortlapse of time. Making it probably easier to
find the appropriate locking strategy.
Tricky. Indeed the situation I used the long response page in was easier.
Pierre.
-----Original Message-----
From: Jonathan Rochkind [mailto:email@hidden]
Sent: Thursday, December 05, 2002 6:13 PM
To: Pierre Bernard; email@hidden
Subject: RE: While The Database Searches...
Ah, good point. But if the point of the long response page is to fetch data that will be used in the rest of the app, it does no good to just have the data in a special EOEditingContext. Hmm, can you fault it back to the main EC without causing another trip to the db? I'm not sure.
Was the extra EC you created a peer or nested EC?
At 05:41 PM 12/5/2002 +0100, you wrote:
>I have used the long response page in the past with EOF stuff.
>
>I created a new context within my performAction method and properly locked >it. At the end of performAction I unlocked and disposed of it.
>If I remember well I passed all required parameters as global IDs to the >long response page.
>
>Seen no trouble.
>
>Pierre.
>
>
>-----Original Message-----
>From: Jonathan Rochkind [mailto:email@hidden]
>Sent: Thursday, December 05, 2002 5:39 PM
>To: Pierre Bernard; Jonathan Fleming; email@hidden
>Subject: RE: While The Database Searches...
>
>
>At 04:17 PM 12/5/2002 +0100, Pierre Bernard wrote:
> >The short answer: com.webobjects.woextensions.WOLongResponsePage
>
>Yes, but the long answer is unfortunately that using WOLongResponsePage
>with EOF access (such as a database search) brings up really tricky issues >of locking, that I am not sure if anyone has ever solved.
>
>Still, this is the official answer. WOLongResponsePage. Maybe it'll work >fine.
>
>
> >Pierre.
> >
> >-----Original Message-----
> >From: Jonathan Fleming [mailto:email@hidden]
> >Sent: Thursday, December 05, 2002 4:10 PM
> >To: email@hidden
> >Subject: While The Database Searches...
> >
> >
> >How can I show an animated graphic while the application is doing a database
> >search and then hide the graphic once all the data is in or the page has
> >fully loaded?
> >
> >I would imagine a conditional and a boolean would be invloved here but I can
> >not find a method to tie it all together.
> >
> >Is this possible or am I being too ambitious with WebObjects? I have
> >actually seen this on other sites but I don't know if they are running a
> >WebObjects application.
> >
> >Kind regards
> >Jonathan
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
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.