Re: How to handle trigger from database.
Re: How to handle trigger from database.
- Subject: Re: How to handle trigger from database.
- From: Ken Anderson <email@hidden>
- Date: Mon, 20 Jun 2005 16:23:20 -0400
He first has to know that something changed so that he can refault
the object(s).
There are some notification methods that are available, one in
Project Wonder and there's also the change notification framework
ported from 4.x by the wirehose guys. Both are designed to be used
between WebObjects instances, so they're pretty tailored to that (not
specifically to interact with the outside world like a Cocoa App).
I think there are a couple of ways you could approach this. I
believe Wonder uses JMS to to notify apps that something has
changed...you could always call some Java from Objective-C that sends
a JMS message to all parties involved when a record changes. Since
you won't have EOF on the Cocoa app, you would have to manually
create the equivalent global ID so the WebObjects EOF apps would know
what you're talking about.
Another option would be to use either framework, and write a Web
Service on your WO app that would be notified whenever something
changed, and that WO app could send out a notification via Wonder or
Wirehose's framework.
However, if it were me, I would have the Cocoa App get all of its
data via Web Services from the WO App. Then you'd have a nice
architecture, and you wouldn't have to re-invent EOF global ID's in
the Cocoa app so you could speak the same language with the WO App.
If your application is not too complex, this would be my solution.
Ken
On Jun 20, 2005, at 4:04 PM, Ricardo Cortes wrote:
The default locking strategy with EOF is optimistic. So, if the EOF
stack finds that a record has been changed when it tries to update
that
record an EOGeneralAdaptorException will be thrown. By default EOF
doesn't do anything with this exception but you can catch it in your
saveChanges() invocation if you'd like. Then, if you want you can
refault the changed objects and inform the user what happened and give
them the option to save the object again. Hope that helps...
--
Lead Software Engineer
email@hidden
Bolt Media - www.bolt.com
On Mon, 2005-06-20 at 12:37 -0700, Theodore Petrosky wrote:
I have a cocoa app that uses that c libraries (libpq)
to talk to a postgresql server. I have been toying
with webobject over the last year to see if talking to
the backend was doable. I am happy with the results.
I am starting a new example that has me stumped. I
have triggers on the database such that if a given row
is updated, the database will generate a notification
to any client that is looking at that row.
Is this kind of functionality doable with WebObjects?
If a client in webobjects is looking at a row of data,
and an update comes from my cocoa app, I want the
webobjects page to know.
Ted
__________________________________
Discover Yahoo!
Find restaurants, movies, travel and more fun for the weekend.
Check it out!
http://discover.yahoo.com/weekend.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40boltstaff.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com
This email sent to email@hidden
_______________________________________________
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