• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB and synchronisation

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have sent a PM to Howard.
Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic