[Clustering/JBoss] - Re: Session Replication - Concurrency Problems?
by bstansberry@jboss.com
Even with REPL_SYNC you need sticky sessions to work. It's possible to get two concurrent requests for the same session.
1) Think IFRAMEs or similar stuff. Nothing prevents browsers making simultaneous requests.
2) Similarly, the webapp can flush or even close the HttpResponse's OutputStream/PrintWriter, pushing content back to the browser before the session repl code considers the request done and replicates the session. Browser could parse that content and generate another request.
There's a JIRA to look into preventing the webapp closing the OutputStream/PrintWriter, but preventing a flush could break some applications.
I'll look at the mod_proxy bit in the morning.
If the system's not under load and you have a reasonable delay between requests, the session should be replicating in time. One thing I just observed last week with 4.2.0 though was that there was occasional > 500 ms latency in replication message transmission when the UDP.enable_bundling attribute was set to "true" in tc5-cluster.sar/META-INF/jboss-service.xml. With that set to false the testsuite REPL_ASYNC tests worked fine with a 100 ms delay between requests. The same thing probably holds true in 4.0.5.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044522#4044522
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044522
19 years, 1 month
[JNDI/Naming/Network] - Same JNDI name in multiple EAR files: Mix up?
by mhassel
Hello, I have the same session bean library included in multiple EAR files - they perform the same functionality, just the persistence.xml for the underlying entity beans points to different databases.
Code examples below!
The web-middle tier (a jsf backing bean) now does a jndi lookup like this
Context ctx = new InitialContext();
| DataManager) manager = (DataManager)ctx.lookup("someprefix/ejb/DataManagerBean");
|
The data I get suggest that multiple calls of this code connect to different "versions" of the same session bean - the the data comes from different databases. It seems that the manager returned can be - rather random - from any one of the deployed ear files....
The JNDI name is the same within any ear file, but can anyone suggest a way to restrict the lookups to the ear file without having to rename every bean???
Thanks!
Example:
@Remote
| public interface DataManager {
| ...
| }
|
|
| @Stateless
| @RemoteBinding (jndiBinding="someprefix/ejb/DataManagerBean")
| public class DataManagerBean implements DataManager {
|
| @PersistenceContext(unitName="ONEOFMANYUNITS")
| private EntityManager em;
|
| // ...
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044514#4044514
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044514
19 years, 1 month