+

Search Tips   |   Advanced Search

(iseries)

Enterprise beans back up and recovery best practices

The following items should be considered for backup when using enterprise beans.


Database data

Enterprise beans often use a database for back-end persistence. Container-managed persistence (CMP) entity beans always use a database for back-end persistence. This data should be backed up the same as any of the business data.

The collection for container-managed entity beans persistence is determined by either the schema name specified during deployment, or the schema specified on the data source associated with the enterprise bean. Any persistent store used by session and bean-managed beans is defined by the bean implementation. For database tables, we can choose to save the entire collection or an individual table as shown with the following commands, respectively:

SAVLIB LIB(EJB) DEV(*SAVF) SAVF(WSALIB/WSASAVF)
SAVOBJ OBJ(MYBEANTBL) LIB(EJB) DEV(*SAVF) OBJTYPE(*FILE) SAVF(WSALIB/WSASAVF)

It might be possible to save database objects while the product is active, if the save operation can obtain a snapshot of the data store. You may have to shut down if a snapshot cannot be obtained. This occurs if there are requests that obtain locks or have open transactions against the database being saved.


EJB source code, class files, and deployed code

When you deploy enterprise beans, a WAS-specific implementation of the enterprise beans is generated. Save these deployed Java(TM) Archive (JAR) files to avoid redeploying, and to preserve any binding information that was specified during the application installation. The JAR files, application code and configuration, such as bindings, are located by default in the profile_root/installedApps directory. By saving this directory, you save the installed applications, including HTML, servlets, JSP(TM) (JSP(TM)) files, and enterprise beans. Normally, each application is located in a separate subdirectory, so we can choose to save all applications or a subset.

The following commands have been wrapped for display purposes. Enter each as a single command.

This command saves all installed applications:

SAV DEV('/QSYS.lib/wsalib.lib/wsasavf.file')
 OBJ(('/profile_root/installedApps'))

This command saves the sampleApp application only:

SAV DEV('/QSYS.lib/wsalib.lib/wsasavf.file')
 OBJ(('/profile_root/installedApps/cellName/sampleApp.ear'))

If we have located utility or general purpose classes in other directories, such as /profile_root/lib/app or /profile_root/lib/ext, be sure to include those locations in the backup plan as well.


Administrative configuration

For more information, see the topic Introduction: Administrative configuration data.


Related concepts

  • Introduction: Administrative configuration data