Skip Headers

Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Hot Deployment of EJB

Many J2EE containers support hot deployment, a feature that enables you to deploy EJB on a running server. Hot deployment allows you to do the following:

- Deploy newly developed EJB to a running production system.

- Remove (undeploy) deployed EJB from a running server.

- Modify (redeploy) the behavior of deployed EJB by updating the bean class definition.

The client receives deployment exceptions when attempting to access undeployed or re-deployed bean instances. The client application must catch and handle the exceptions.

How you configure hot deployment of EJB depends on the type of J2EE application you are deploying:

- Hot Deployment in a CMP Application

- Hot Deployment in a non-CMP Application

For more information about hot deployment, see the J2EE container documentation.

## Hot Deployment in a CMP Application

When you take advantage of hot deployment in a CMP application, consider the following:

- You must deploy all related beans (all beans that share a common TopLink project) within the same EJB JAR file. Because TopLink views deployment on a project level, deploy all the project beans (rather than just a portion of them) to maintain consistency across the project.

- When you redeploy a bean, you automatically reset its TopLink project. This flushes all object caches and rolls back any active object transactions associated with the project.

## Hot Deployment in a non-CMP Application

When you take advantage of hot deployment in a non-CMP application, you must refresh the TopLink session using the `SessionManager` method `getSession` with the appropriate arguments (see "Refreshing a Session when the Class Loader Changes".

If you do not use this `SessionManager` method, then your application is responsible for destroying or refreshing the session when a hot deployment (or hot redeployment) occurs.