Jeremy Leicester wrote:
> 
> I have an Entity Bean and a Session Bean.
> The Session's method update() is called from client code.
> Session.update() calls Entity.update() which does some set() methods on
> the Entity.
> A NOT NULL column in the database gets set to null from this call.
> 
> The problem is that the Session.update() completes successfully without
> catching the SQLException that is thrown. The client code sees that no
> update was made but has no exception to notify it.
> 
> How do you check to make sure that the store is successful when it
> happens after
> the code calling it has finished executing.
> 
> Please reply to [EMAIL PROTECTED]
> 
> Thanks!

Hello Jeremy,

I'm sorry but I need more information to fully understand what
the problem is.
        - is the entity bean container managed persistence,
        or bean managed persistence ?
        - what is the type of the field ?
        - .....
A part of the source code of the Entity.update() and Session.update()
may be useful.

However, I'm going to try to give a beginning of answer, in case of
an entity with container bean managed.
The code generated by the container tool for accessing the
data in the relational database is 'surrounded' with the following
try-catch statement:
        try {
            ... JDBC statement ...
        } catch (Exception e) {
            log the exception 'e'
            throw new RemoteException("....blabla.....", e);
        }
(The java.sql.PreparedStatement method used is setNull() when a
 field of the bean is null.)
So, if a SQLException is throwned by the JDBC driver,
the Session.update() may catch a java.rmi.RemoteException with
the SQLException as 'detail' variable value.
Could you please have a look to the log of the server to check if
an SQLException is catched ?

Regards.
-- 
-=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  mailto:[EMAIL PROTECTED]    http://www-frec.bull.com
  Phone: 33.4.76.29.73.53          Fax: 33.4.76.29.76.00
 Download our EJB Server JOnAS at http://www.bullsoft.com/ejb
_______________________________________________________________

Reply via email to