[jboss-user] [EJB3] - Stateless EJB lifecycle

Ivan Pazmino do-not-reply at jboss.com
Tue Nov 2 12:36:01 EDT 2010


Ivan Pazmino [http://community.jboss.org/people/iapazmino] created the discussion

"Stateless EJB lifecycle"

To view the discussion, visit: http://community.jboss.org/message/569354#569354

--------------------------------------------------------------
I have a stateless ejb3 component that's serving to business methods an  insert to the database and a query to the data base. In a @postconstruct  method I get a connection from an injected datasource, and, in a  @predestroy method i close the connection and null the datasource  reference.
 
 In a client I get a reference to the stateless component injected. Then,  in different times, I call one of the method business and then the  other. Always the that is called first performs its task and finishes  successfully. But the second method fails complaining the connection is  not associated with a managed connection.
 
 Shouldn't the connection be alive as long as the slsb has not been destroyed?
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/569354#569354]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101102/a923a157/attachment.html 


More information about the jboss-user mailing list