Hi All, My problem originates when an exception is generated after performing an SQL transaction. When i query the DB and pick up a value which can be null from the DB and perform some operation on the value, if the value returned is null...an exception is generated. This is done in the Bean, and the exception is caught in the Servlet. I throw an error page but after i come back to the home and perform any other operation from the home page or any other page a bean deleted exception is generated. I am using a stateful session bean where the functions are present and the servlets call these functions. I think the problem is because the link to the handle of this stateful bean is lost, why does that happen if an exception occurs and how can it be avoided.
"Preetham", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements. Thanks.
Throwing a Runtime exception from a Stateful Session EJB will delete that instance of the EJB per the Specification. In our application, we always explicitly check for NULL (using == or resultSet.wasNull() method depending on circumstance) before performing operations on Objects retreived from the Result Set.