• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about ejbActivate and ejbPassivate

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a qeustion about ejbActivate and Passivate.
In the HFEJB 203page, When ejbPassivate completes, every non-transient instance variable MUST be a reference to one of the following.
...
A resource manager connection Factory(DataSource)
...

and the next page

a JDBC connection is not Serializable, so if you have one, you must set it to null in ejbPassivate().

My Question is that .JDBC connection is not Serializable. But it is a resource manager connection factory. is it?

I am not english native speaker... so i might misunderstand of this concept.
The things on the list (203page) are fine for activation and passivation. so I do not care of them.
Except the list, I need to care. One of them is JDBC connection.

If i am right, What is a resource manager connection factory?

cheers.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are mixing Datasource and Connection, from the JDBC API.
You can keep a reference to a Datasource (which provides connections), but not a reference to a Connection. The connection must be closed and cleared.
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DataSource is also non-serializable.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

DataSource is also non-serializable.


No, but it does not need to. For passivation, instances variables must be one of the following :

� A serializable object.
� A null.
� An enterprise bean's remote interface reference, even if the stub class is not serializable.
� An enterprise bean's remote home interface reference, even if the stub class is not serializable.
� An entity bean's local interface reference, even if it is not serializable.
� An entity bean's local home interface reference, even if it is not serializable.
� A reference to the SessionContext object, even if it is not serializable.
� A reference to the environment naming context (that is, the java:comp/env JNDI context) or any of its subcontexts.
� A reference to the UserTransaction interface.
A reference to a resource manager connection factory.
� An object that is not directly serializable, but becomes serializable by replacing the references
to an enterprise bean's home and component interfaces, the references to the SessionContext object, the references to the java:comp/env JNDI context and its subcontexts, and
the references to the UserTransaction interface by serializable objects during the object's serialization.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how come we don't have primitive variable in the list?
example : int nSize = 10;
 
Shanthala Baleger
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
-------------------------------
resource manager connection factory
------------------------------------

coudl you please give references to read and understand more about the "resource manager connection factory"?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

how come we don't have primitive variable in the list?


This list was taken from the EJB specification. I guess that because primitives are natively serializable, they don't need to be mentioned in the list.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic