-
1. Re: How to wait in a MDB ?
ppetit Feb 7, 2002 1:32 PM (in response to lbroudoux)I think you cannot use thread management like wait()within an EJB.
FYI:
wait(long timeout, int nanos)
Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
Perhaps, if your EJBs involved in your process are in the same JVM, the process writing the file could notify the MDB through a listener after completion (Observable Pattern is a good candidate for this).
It's just an idea.
Philippe -
2. Re: How to wait in a MDB ?
lbroudoux Feb 8, 2002 3:46 AM (in response to lbroudoux)Thanks Philippe for your reply ...
And sorry for the 2 posts (a mistake on Edit/Preview screens !)
I have finally succeed in making my MDB wait until the end of the other process. I've done this by making
current thread retrieving my MDB's monitor with synchronized call (on "this") before wait().
(The other process is not a Java process ...)
I have now some other problems : transaction timeout while MDB is waiting (and the trans-attribute
NotSupported doesn't seems to be effective), confusion between topics
(MDBs received messages from topic they aren't listening to ...).
I'm trying to make a SB on JBoss on a first machine, publishing messages on topics on a second machine (using
the JMS ressource adaptor).
Hum ... it's time to dive back into this problems !
Regards,
Laurent -
3. Re: How to wait in a MDB ?
pra Feb 8, 2002 3:59 AM (in response to lbroudoux)This has been discusses (and solved before - Hiram do you remember this?). Search on the dev list.
//Peter -
4. Re: How to wait in a MDB ?
nikolaj Feb 14, 2002 6:08 AM (in response to lbroudoux)Hi Peter,
Stupid question here... where is the "dev" list. Thanks. -
5. Re: How to wait in a MDB ?
hchirino Feb 20, 2002 12:00 AM (in response to lbroudoux)The fix is use a CMT with NotSupported or use a BMT.
In either case the Transaction Manager is not used since a 2 phase commit will not be required.
I'm not sure if this has been back ported to 2.4.4, but I know it is in 3.0.
Regards,
Hiram