Session find methods and entety beans

Discussions

EJB design: Session find methods and entety beans

  1. Session find methods and entety beans (1 messages)

    I am using Orion and a mix of session beans and entity benans. And have noticed that a change in a entity bean is not reflected in result retuned from a find (jdbc) from a session bean running in same transaction.

    Are this topic covered in the EJB spec?

    I a mix of session and entity beans or accessing database not a good solution?
  2. Session find methods and entety beans[ Go to top ]

    EJB spec. 2.0, item 10.5.3 ("Container's view") page 177:

    "The Container is responsible for ensuring that updates to the states of all entity beans in the
    same transaction context as the ejbFind<METHOD> method are visible in the results of the
    ejbFind<METHOD> method. Before invoking the ejbFind<METHOD>(...) method,
    the container must therefore first synchronize the state of any entity bean instances that are participating
    in the same transaction context as is used to execute the
    ejbFind<METHOD>(...) by invoking the ejbStore() method on those entity bean
    instances."

    Put your finders where they belong (in the EB's home) and the spec sees to it that you find what you're looking for...