Hi All,
Got a major problem in implementing the ejbstore method for a stateless BMP. I am using session beans and entity beans in my code. From the session bean using a framework class(reflection) I am calling a method on the entity bean (setXXX for which the transaction attribute is : requires new). This method sets the attribute of the entity bean. Now after calling the setXXX method, as a postinvoke ejbstore is called which is going to insert/delete/update the values in the database. However if any errors are encountered during the database operations I am throwing an EJBException. The exception is getting thrown from the ejbstore correctly however the postinvoke method (in the generated stubs) is not catching the remote exception. Is this because I am using Local Interfaces? What should be done in this case, what should be done to ensure that the postinvoke/container correctly converts the exception into remote exception, catches it and throws it back to the calling framework class which in turn throws the exception to the session bean. Here is how the code looks like:
session bean
private xxxmethod()
{
frameworkclass.executemethod(entitybeanreference, methodname(setXXX),parameters)
}
frameworkclass
executemethod()
{
try
{
get the interface type
and callthe method
}
catch(invocationtargetexception)
{
}
stubs
{
call the setXXX method
and as a postinvoke
postinvoke()
catch(remoteexception e)(The problem is here. the ejbexception thrown by ejbstore is not caught and instead it returns a successful response)
{
}
Please help...