facebook

What does happen with database conn when ejb is passivated?

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #206973 Reply

    Hi…what does happen when an ejb is passivated…
    Are his database resources freed or do I have to free then via the ejbpassivated method.

    thanks in advance

    #206982 Reply

    Scott Anderson
    Participant

    Actually, you should probably be obtaining and releasing connections as needed, not holding onto them. These operations are quite fast as the connections come from the server’s connection pool, so closing a connection simply returns it to the pool.

    #206992 Reply

    Scott Anderson
    Participant

    From the EJB 2.0 spec, section 7.4:

    In advanced cases, a session object’s conversational state may contain open resources, such as open
    sockets and open database cursors. A container cannot retain such open resources when a session bean
    instance is passivated. A developer of such a session bean must close and open the resources in the
    ejbPassivate and ejbActivate notifications.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: What does happen with database conn when ejb is passivated?

You must be logged in to post in the forum log in