[Tomcat, HTTPD, Servlets & JSP] - Cluster-wide Session Access
by armorris007
I'm currently trying to find a way to gain access to a cluster-wide list of active Tomcat Sessions. This is proving very difficult.
I've looked at the possibility of using the HttpSessionListener interface but unfortunately that won't suffice - as it's not fail-safe when it comes to a node in a cluster unexpectedly going away.
The problem I'm trying to tackle is that of implementing a session-tracking licencing engine for our J2EE product. Essentially - I want to be able to read an attribute (that is set at login) from a session and count how many sessions have that attribute set.
Having scoured the JMX console for ways that existing JMX components get this information, it would appear that such information is available to:
The MBEAN registered under the jboss.web domain:
host=localhost,path=/myapplication,type=Manager
however, I can't for the life of me work out how to do a JNDI lookup to get access to that MBEAN - it doesn't appear to be registered in JNDI (when using the JNDIView component).
However - the jmx-console itself can see the component fine - and can execute calls on it.
Can anyone help? Or advise an alternative solution to cluster-wide session access?
Many thanks,
Andy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959202#3959202
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959202
19 years, 10 months
[Persistence, JBoss/CMP, Hibernate, Database] - Maybe a bug on EntityManager.createNativeQuery(String)
by petrilla
I need to do some sql native query (to a data base Oracle 9i) from an EJB session Bean.
I use Jboss in version 4.0.4 G.A. patch 1
My simple code :
public List doNativeQueryMultiple(String sqlQuery) {
List list = manager.createNativeQuery(sqlQuery).getResultList();
return list;
}
This is some exemple for understand the probleme.
SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
Response is : O,N
SELECT 'TOTO' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
Response is : TOTO,NON
SELECT 'TOT' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
Response is : T,N
SELECT 'OUI' val FROM dual union SELECT 'abc' FROM dual Order BY 1 asc
Response is : O,a
SELECT 'OUI' val FROM dual union SELECT 'abcd' FROM dual Order BY 1 asc
Response is : OUI,abcd
SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual union SELECT 'TOT' FROM dual Order BY 1 asc
Response is : O,N,T
SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual union SELECT 'TOTO' FROM dual Order BY 1 asc
Response is : OUI,NON,TOTO
When the response of the request is correct, the return class type is java.lang.String
And when is incorrect , the return class type is java.lang.Charactere, and the response contain the first letter.
The bug is when the size of all of the selected string have the same length.
The test done by Jboss for determine the class return type maybe is wrong.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959197#3959197
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959197
19 years, 10 months