• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java object with a stateless session bean

 
Kodo Tan
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Suppose I have a Java object that acts like a DAO (i.e. uses the JDBC) and used it within a stateless sesssion bean, am I right to say that concurrency to each database record is in place but not data persistence, that is, the bean does not survive a server crash ?
 
herve attia
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kodo Tan:
Hi all
Suppose I have a Java object that acts like a DAO (i.e. uses the JDBC) and used it within a stateless sesssion bean, am I right to say that concurrency to each database record is in place but not data persistence, that is, the bean does not survive a server crash ?

I think...when you wrote about stateless session bean : "the bean does not survive a server crash" ...it is not correct.
First of all, stateless session bean doesn't maintain any persistent state on behalf of the client (OK, it can have member variable associated with the bean -like a connection to a legacy system- but nothing related with the client)
If the server crash, in a clustered configuration, the system can redirect to another stateless session bean (stateless are all equivalent in the system ). From the client, it is transparently, its stub has just been rebind to another beans !!
A STATEFUL session bean doesn't survive a server crash !! Although, most of application server provides recovering mechanism....however, cluster a stateful session affect scalability as well.
Personally, for the assignment, I kept lifetime of stateful session bean as short as possible.
Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic