First page Back Continue Last page Graphics
Entity Beans...
A client can "remove" an entity bean
- Represents deleting entity from database
- Container executes an SQL delete
- Note: Bean instance is returned to pool, not destroyed!
Client uses same remove( ) method of EJBObject:
-
-
- javax.ejb.RemoveException
- Thrown if container or bean will not allow bean's removal
- Must be caught
Notes:
As with session beans, “removal” also applies to entity beans, but with a different meaning. Since an entity bean is the object representation of a data entity, removing the bean means deleting the entity from the database.
A client can remove a bean by calling the remove( ) method of its EJBObject interface, just as with session beans. The RemoveException is thrown if the container or the bean will not allow the bean's removal for some reason. RemoveException extends Exception, so it is checked (it must be caught).