| Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.5.0) Part Number E13981-01 |
|
|
View PDF |
You can specify the directory and file name to which OC4J serializes an EJB 3.0 stateful session bean when passivated using OC4J-proprietary annotations (see "Using Annotations") or using the orion-ejb-jar.xml file (see "Using Deployment XML").
For more information, see the following:
You can specify OC4J-proprietary deployment options for an EJB 3.0 stateful session bean using the @StatefulDeployment OC4J-proprietary annotation. Example 5-1 shows how to configure the passivation location for an EJB 3.0 stateless session bean using the @StatefulDeployment annotation persistenceFileName attribute.
For more information on this @StatefulDeployment attribute, see Table A-1. For more information on the @StatefulDeployment annotation, see "Configuring OC4J-Proprietary Deployment Options on an EJB 3.0 Session Bean".
Example 5-2 Configuring Passivation Location Using @StatefulDeployment
import javax.ejb.Stateless;
import oracle.j2ee.ejb.StatelessDeployment;
@Stateless
@StatefulDeployment(
persistenceFileNazme="C:\sfsb\sfsb.persistence",
)
public class HelloWorldBean implements HelloWorld {
public void sayHello(String name) {
System.out.println("Hello "+name +" from first EJB3.0");
}
}
For an EJB 3.0 stateful session bean, you configure passivation location in the orion-ejb-jar.xml file as you would for an EJB 2.1 stateful session bean (see "Using Deployment XML").