File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB and synchronisation

 
sunil s phanse
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Can i call any synchronized method of a class from an EJB. We r facing a problem wherein we are calling 1 synchronized method from onMessage() of MDB.
We are trying to use the 3rd party Java classes available for connection pool. They have implimented this in java class inside synchronized method/block. When we call this from EJB we face problems. Is there any solution to this other than doing everything inside EJB
[ December 05, 2003: Message edited by: sunil s phanse ]
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of "problems" do you face? What is happening?
The EJB spec forbids you to make EJB methods synchronized, but it's generally OK to call a synchronized method in a helper class...
Kyle
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but it's generally OK to call a synchronized method in a helper class...

That is a violation as well,isn't?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it's a bit of a grey area. Section 24.1.2 of the EJB 2.0 spec says
"� An enterprise Bean must not use thread synchronization primitives to synchronize execution of multiple instances.
Same reason as above. Synchronization would not work if the EJB Container distributed enterprise bean�s instances across multiple JVMs."
This is the only statement about synchronization primitives in the spec that I know of. In fact, the usual test for this is to make sure that none of the EJB methods themselves implement synchronized, no vendor that I know of will check the call trees descending from the bean.
Kyle
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kyle,
Thanks.
How is your Websphere book writing going on ? Does IBM plan to come out with any Webservices certifications?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pradeep.
The WebSphere book should be released on December 17! As for Web Services certifications, I know some are in the pipeline but aren't aware of any dates. You may want to ask Howard Kushner -- his company is usually deeply involved in writing the tests and certification guides.
Kyle
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kyle Brown:
Hi Pradeep.
The WebSphere book should be released on December 17! As for Web Services certifications, I know some are in the pipeline but aren't aware of any dates. You may want to ask Howard Kushner -- his company is usually deeply involved in writing the tests and certification guides.
Kyle

Are you planning for any book promotion ?
How do I contact Howard Kushner ?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My book will be featured on JavaRanch the week of January 20th. Howard hangs around here -- do a search for his name, then PM him.
Kyle
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have sent a PM to Howard.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic