File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Using a EJB with threading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Using a EJB with threading" Watch "Using a EJB with threading" New topic
Author

Using a EJB with threading

William Ross
Greenhorn

Joined: Jul 06, 2006
Posts: 12
As I understand it the ejb takes care of threading for us? What I am trying to do is syncronize a method so that only one thread can be using it at a time. However, I get an error when I try to use syncronize. What I think is happening is the ejb is running multiple instances of this method at a time due to threading. But I want only one flow of control within this method. Sorry if this sounds confusing; I can clarify more... thanks.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

In J2EE, you generally should avoid any and all thread management. In particular, you should never spawn threads.

What do you need synchronized methods for? If it is for a static object, there are better solutions to manage singletons in a J2EE environment.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using a EJB with threading
 
Similar Threads
NX: Passed B&S 387/400
about syncronization
Class Lock in Threads
Threading
Please Answer.