EJB server bean behaves as shared memory
I'm using Dom to communicate between servlet and my Bean
i've added som dom structures in my servlet session environment
An I'm passing that structure between servlet and Bean
virtualy as shared memory
Servlet code extract
--------------------
Session ses=(Session) session.getAttribute("REQinfSession") ;
Where ses is a class containing a dom4j structure
Document ses.dom ;//session Dom Document
...
Ejb request
-----------
requests are passed to the service bean with the calls like
Node nod=ses.dom.selectSingleNode("/root/loadtestmap/@id");
nod.setText("userInfo");
DomBean_INTF dombean = (DomBean_INTF)
JNDI.Bean("ejb/dommer/local");//connecting to the bean
if (dombean != null)
{ String status=dommbean.Load(ses,Request);//the dombean
gets the session as transport buffer and gets what to do from
;// from the Request
only the pointer to the session class ses is passed to the
bean
Bean code extract
-----------------
public String dom(Session ses,String Request)
ses.dom is manipulated using standard Dom request
Node nod=ses.dom.selectSingleNode("/root/loadtestmap/@id");//get
information from the servlet
String inf =nod.getText();
....
Node nods=ses.dom.selectSingleNode("/root/dbInfo");//get info
from the database ...
nods.setText("returned info and structures"));//place it in
the dom structure
return status;
Of coarse there are structures to ensure session and transactional
consistency is maintained in the
in the bean
actualy the ses session structure is shared memory between Servlet
and bean.
I hope it is not copied arround every time ( interconsistency
would be attacked)
Any suggestions , critics ....
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3947953#3947953
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3947953
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user