Hi all,

How can i catch a container exception generated by the container?

I have an existing row in a database with [ID not null, FIELD1 not null, 
FIELD2 not null].

When I perform an update, I do it by using an object with these 3 fields.

So in my session bean, I have:

Public void update() {
  try {
    myClass theClass = m_home.findByPrimaryKey(new PK(ID));//Use of an 
entity EJB
    theClass.setData(ID, �field1�, �field2�);
  } catch(Exception e) {
  }
}

in that case, when the ejbStore in the entity bean is performed, the update 
is done.

But if a have field2 = null so

Public void update() {
  try {
    myClass theClass = m_home.findByPrimaryKey(new PK(ID));//Use of an 
entity EJB
    theClass.setData(ID, �field1�, null);
  } catch(Exception e) {
     //generate an xml file containing the error message
  }
}
Then, an Oracle exception is generated of the kind:
    ORA-01407:cannot update ("SCHEMA"."TABLE"."FIELD2") to NULL

It is ok up to now.  The problem is that I want to catch the exception to 
return information to the client.  For that, I have to catch the exception.  
If in the entity bean a throw explicitly an EJBException, I can catch it.  
But if it is the container that generates that error, I am unable to catch 
it.  So, what can I do????

Please help

JMi

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]

Reply via email to