concurrency - Distributed Locking and Java EE -


Writing Java AE application using Zebus AS6 and I have resources that require exclusive use (for some interface). Currently, I'm using java.util.concurrent.RententLock to handle miscreant (since) and locking for a third-party software for a method for any parameter. .

Now I am clustering with many JBS application servers together so that I need a solution that works in different nodes in the cluster. I think I have at least the following options.

  • File system based locking (probably bad, but we
  • databases
  • 's?

    Ideally, I am looking for a high level API so that I can write EJB methods like this

     Public class MyEJBBean {Private Shared Lock Lock; Public Zero doSomethingWithSharedResource (String S) {lock.lock (); // The blocks unless shared resources are not used by anyone else {// Sh Use the resource} Finally {lock.unlock ();}} I have not left any option? Does anyone have any experience with such locking mechanism Can they share?   

    Ideally, I would suggest only one example of third-party software By wrapping in a separate application running on it. In this way you can handle locking using EJB lyricists (I believe @Singleton will not help you in your situation) and show it using remote EJB / WS It seems that this piece of software is a bit dirty (single-threaded?) So that more user-friendly EJB interfaces will be an added benefit.

    Think about it - if you can reach the library only once, the time for the whole system, why disturb it sharing? Always be able to use the most an example in any way.

    If you want to be with the homogeneous distribution system (which is not normally a bad idea), then I suggest that for the SELECT update I have ever tried it But I think that before using your library (getting lock), you have to do the trick after issuing such a SQL and giving EJB container transactions (to effectively lock the lock).

  • Comments