[JBoss Messaging] - Messaging Cluster scenarios
by kapilanand
I have two questions regarding the messaging cluster. I could not find the answer in the documentation.
This is what I need to achieve:
Jboss messaging cluster to provide seamless fail-over for the publishing and subscribing clients.
Persistence and durable subscription are not needed. In other words, an unreliable but highly available replicated topic.
1. HA and load-balance without persistence
Messaging doc says that a shared DB is required for the cluster to work. Before that it states that the post-office will not work without a DS. I am aware that embedded DB may be configured to avoid persistence until a threshold of memory usage is hit.
My question related to this:
- Would I need the shared DB even if I use these clustered post-offices to host non-persistent (non-durable) subscriptions, that is, is it used to manage the cluster information as well?
- Is it OK to use HSQLDB or Derby if the above is not true?
2. Recovery from a cluster restart
Since Jboss messaging relies on a clustered ConnectionFactory registered in a clustered JNDI to provide the failover mechanism, would the client need to re-lookup JNDI and reopen connections and sessions to get back in business? This seems unnecessary since all participating post-offices seem to be bound to a pre-defined host and port, but then I am not sure how it is different from a clustered Stateless session bean.
thanks
kapil
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128535#4128535
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128535
18 years, 2 months
[EJB 3.0] - How to do a Table lock with EJB3
by sappenin
In an EJB3 SLSB, how do I lock a database table so I can do a read, then a write in the same unit of work without having another calling thread do work in between? Please note that EntityManager.lock(...) will not work here because I need to lock the table BEFORE I create an entity.
Here's the logic I'm looking for:
1.) Lock the Database Table.
2.) Read from the table to see if an object exists that meets my query requirements (the query use pk and non-pk data).
3a.) If no data exists (that meets the requirements in #2), then create a new entry in the DB, and return this entry to the caller.
OR
3b.) If data *does* exists that matches the criteria set forth in #2 above, then return null to the caller. The caller will retry later in an attempt to get his object.
4.) Release the table lock
--
How do I do this with the EJB3 entityManager? I've annotated my SLSB function with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW), but this doesn't prevent 2 callers from receiving "false" in #2 above, and hitting #3 at the same, thus returning a different object to both callers.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128531#4128531
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128531
18 years, 2 months