wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes EJB scheduler and thread synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB scheduler and thread synchronization " Watch "EJB scheduler and thread synchronization " New topic
Author

EJB scheduler and thread synchronization

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I have an EJB scheduled job run at 00:30AM every day, it will read an external file in the system, like /usr/myproject/feed.xml. inside the scheduler, I didn't create any multiple threads.

Question is, when I deploy codes to multiple cluster / instances, do I need to worry about synchronized issue ? is it possible that the feed.xml is accessed by two threads from two instances at the same time ?

Thanks

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1077
    
  10

Which version of EJB are you using? If it is 3.1, you can create an EJB as a singleton with the @Singleton annotation - this along with @Schedule annotation should make it simpler to wrote code.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB scheduler and thread synchronization