Can I store objects in a JNDI tree that contains active connections and
sessions to a JMS message provider(JMS). Do all objects that are stored in
the JNDI have to serializable and therefore cannot contain non-serializable
objects.

If not how do I store object that contain connections. My problem is as
follows.I have stateful EJB's that has connections,sessions to a JMS
provider. The bean then creates a temporary queue. Clients of the bean call
business methods that check to see if a message is delivered to the
temporary queue.

However during bean passivation(serialization), the connections are lost.
That is not a problem as I can reconnect in ejbActivate but I lose the
temporary queue. I wanted store the connection object(that encapsulates all
the JMS stuff) in a JNDI tree during ejbPassivate and then get a refrence
back to it during ejbActivate. All this works well in Weblogic but I wanted
to know if there is anything in the JNDI spec that would make my code
non-portable. That is when I bind my object to a name
Any ideas??


public class AnyStatefulBean{

String name;
MyConnection con;

{

ejbCreate()
{
   this.con = new MyConnection();
}

ejbPassivate()
{
  this.name = this.con.toString();
  context.bind(this.name, con);
}

ejbActivate()
{
   this.con = (MyConnection)context.lookup(this.name);
}

}



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to