Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Dataslot management : Working with different types of dataslots : OBJECT dataslots : Dynamic class loading for object dataslot
 
Dynamic class loading for object dataslot
Business Process Server provides a functionality to allow modifications to an Object dataslot’s class and deploy such a modified class when the EJB application server is up and running. In other words, in current version of Business Process Server, there is no need to restart EJB application server to use a newer version of Object dataslot’s class.
Current infrastructure of dynamic class loading for adapter classes is used to provide dynamic class loading for Object dataslots. Thus, the folder locations to place class files for Object dataslots are same as those used for adapter classes. For more information, see Dynamicclass loader for adapters. When a process template gets installed, the class of the Object dataslot is loaded for the first time. If a class is modified at runtime, then it is loaded during the next process instance creation.
Since Object dataslot’s object instance is serialized and stored in a database, it is strongly recommended to define a private static member variable as shown below in the Java class of Object dataslot:
"private static final long serialVersionUID = 7526472295622776147L; "
The long value can be obtained by executing serialver.exe from JDK\bin folder providing fully classified class name, for example, serialver com.savvion.MyObject.
Whenever class definition is changed, one should make sure that the long value for this field remains the same.
If the Object dataslot’s class is dependent on one or more other classes, then such classes can be placed in extracted format in ebmsapps folder or they can be placed in the system classpath.
Managed adapters' classes are loaded from the system classpath. Hence, all dependent classes are also loaded by system classloader. If managed adapter invocation is the first operation after server startup, then dynamic class loading does not happen for the Object dataslot classes that are input/output to the managed adapter, since it is already loaded by system classloader.
If an Object dataslot is used in the alert condition code, then the Object code must be placed in the %OEBPS_HOME%\ebmsapps\common\bo\classes folder.

Limitations

*If the class file of an Object dataslot is part of a JAR file, then reading of the Object dataslot using APIs causes a ClassNotFound or De-Serialization Exception. Therefore, it is recommended that Business Process Server applications should not use JAR files for Object dataslots.
*For dynamic loading of Object dataslots, keep Class files under the <OEBPS_HOME>\ebmsapps folder.
*To achieve dynamic class loading of Object dataslot's classes, set the bpserver.classloader.dynamic flag in bpserver.conf to True.
*If new Object dataslots are added during process replacement, then you are required to restart the EJB application server. This is because already cached prepared statements becomes invalid for any schema changes.