Oracle8i Enterprise JavaBeans and CORBA Developer's Guide
Release 8.1.5

A64683-01

Library

Product

Contents

Index

Prev  Chap Top Next

Transaction Examples

clientside

employee.ejb

SessionBean employeeServer.EmployeeBean
{
  BeanHomeName = "test/myEmployee";
  RemoteInterfaceClassName = employee.Employee;
  HomeInterfaceClassName = employee.EmployeeHome;

  AllowedIdentities = { PUBLIC };
  RunAsMode = CLIENT_IDENTITY;
  TransactionAttribute = TX_SUPPORTS;
}

Client.java

import employee.Employee;
import employee.EmployeeHome;
import employee.EmployeeInfo;

import oracle.aurora.jndi.sess_iiop.ServiceCtx;

import oracle.aurora.jts.client.AuroraTransactionService;
import oracle.aurora.jts.util.TS;

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Hashtable;

public class Client
{
  public static void main (String[] args) throws Exception {
    if (args.length != 4) {
      System.out.println ("usage: Client serviceURL objectName user password");
      System.exit (1);
    }
    String serviceURL = args [0];
    String objectName = args [1];
    String user = args [2];
    String password = args [3];

    // create InitialContext
    Hashtable env = new Hashtable ();
    env.put (Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put (Context.SECURITY_PRINCIPAL, user);
    env.put (Context.SECURITY_CREDENTIALS, password);
    env.put (Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    Context ic = new InitialContext (env);

    System.out.println ("Initial Context set up");
		// System.out.println ("begin ATS.init (" + ic + " " + serviceURL + ")");

    // initialize the transaction service
    AuroraTransactionService.initialize (ic, serviceURL);

		System.out.println ("begin ic.lookup (" + serviceURL + objectName + ")");

    // get handle to the employee object
    EmployeeHome employee_home = (EmployeeHome)ic.lookup (serviceURL + 
objectName);
		System.out.println ("begin employee_home.create ()");

		Employee employee = employee_home.create ();

		// System.out.println ("begin TS.getTS ().getCurrent ().begin ()");

		// get Control to the transaction
    TS.getTS ().getCurrent ().begin ();

		EmployeeInfo info = employee.getEmployee ("SCOTT");
		// System.out.println ("Beginning salary = " + info.getSalary ());
		System.out.println ("Beginning salary = " + info.salary);

		// do work on the info-object
		info.salary += (info.salary * 10) / 100;
		// info.giveRaise (10);

		// call update on the server-side
    employee.updateEmployee (info);

		System.out.println ("End salary = " + info.salary);

    TS.getTS ().getCurrent ().commit (true);
  }
}

employee/EmployeeInfo.java

package employee;

import java.rmi.*;

public class EmployeeInfo implements java.io.Serializable {
	public String name = null;
	public int number = 0;
	public double salary = 0;
}
/*
	public EmployeeInfo () { }

	public EmployeeInfo (String name, int number, double salary) {
		this.name = name;
		this.number = number;
		this.salary = salary;
	}

	public String getName () { return name;	}

	public int getEmpNumber () { return number;	}

	public double getSalary () { return salary;	}

	public void giveRaise (int percent) {
		salary += salary * percent/100;
	}
}
*/

employee/Employee.java

package employee;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;

import java.sql.*;

public interface Employee extends EJBObject  
{
  public EmployeeInfo getEmployee (String name) throws RemoteException;

  public void updateEmployee (EmployeeInfo employee) throws RemoteException;
}

employee/EmployeeHome.java

package employee;

import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import java.rmi.RemoteException;

public interface EmployeeHome extends EJBHome
{
  public Employee create () throws RemoteException, CreateException;
}

employeeServer/EmployeeBean.sqlj

package employeeServer;

import employee.*;

import javax.ejb.SessionBean;
import javax.ejb.CreateException;
import javax.ejb.SessionContext;
import java.rmi.RemoteException;

import java.sql.*;

public class EmployeeBean implements SessionBean
{
  // Methods of the Employee interface
  public EmployeeInfo getEmployee (String name) throws RemoteException {
    try {
      int empno = 0;
      double salary = 0.0;
      #sql { select empno, sal into :empno, :salary from emp
	      	where ename = :name };

      EmployeeInfo info = new EmployeeInfo ();
      info.name = name;
      info.salary = salary;
      info.number = empno;
      return info;
    } catch (SQLException e) {
      // throw new SQLError (e.getMessage ());
    }
    return null;
  }

  public void updateEmployee (EmployeeInfo employee) throws RemoteException {
    try {
      #sql { update emp set ename = :(employee.name), 
	sal = :(employee.salary) where empno = :(employee.number) };
    } catch (SQLException e) {
      // throw new SQLError (e.getMessage ());
    } 
    return;
 }

  // Methods of the SessionBean
  public void ejbCreate () throws RemoteException, CreateException {}
  public void ejbRemove() {}
  public void setSessionContext (SessionContext ctx) {}
  public void ejbActivate () {}
  public void ejbPassivate () {}
}

multiSessions

employee.ejb

SessionBean employeeServer.EmployeeBean
{
  BeanHomeName = "test/myEmployee";
  RemoteInterfaceClassName = employee.Employee;
  HomeInterfaceClassName = employee.EmployeeHome;

  AllowedIdentities = { PUBLIC };
  RunAsMode = CLIENT_IDENTITY;
  TransactionAttribute = TX_SUPPORTS;
}

Client.java

import employee.*;

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Hashtable;

public class Client
{
  public static void main (String[] args) throws Exception {
    if (args.length != 5) {
      System.out.println ("usage: Client serviceURL objectName user password 
sessionsCount");
      System.exit (1);
    }
    String serviceURL = args [0];
    String objectName = args [1];
    String user = args [2];
    String password = args [3];
    int sessionCount = Integer.parseInt (args[4]);

    // create InitialContext
    // Note: authentication is done per session in ClientThread
    Hashtable env = new Hashtable ();
    env.put (Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    Context ic = new InitialContext (env);

    // invoke different sessions using ClientThread
    for (int i = 0; i < sessionCount; i++) {
      String sessionName = new String (":session" + i);
      ClientThread ct = new ClientThread (ic, serviceURL, objectName, 
sessionName, user, password);
      System.out.println ("Starting ClientThread (" + sessionName + ")");
      ct.start ();
    }
  }
}

ClientThread.java

import employee.*;

import oracle.aurora.jts.client.AuroraTransactionService;
import oracle.aurora.jndi.sess_iiop.ServiceCtx;
import oracle.aurora.jndi.sess_iiop.SessionCtx;
import oracle.aurora.AuroraServices.LoginServer;
import oracle.aurora.client.Login;
import oracle.aurora.jts.util.TS;

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Hashtable;

public class ClientThread extends Thread
{
  private Context ic = null;
  private String serviceURL = null;
  private String objectName = null;
  private String sessionName = null;
  private SessionCtx session = null;

  public ClientThread () {}

  public ClientThread (Context ic, String serviceURL, String objectName, String 
sessionName, String user, String password) {
    try {
      this.ic = ic;
      ServiceCtx service = (ServiceCtx)ic.lookup (serviceURL);
      this.session = (SessionCtx)service.createSubcontext (sessionName);
      System.out.println ("activating the " + sessionName + " in " + 
serviceURL);

      LoginServer login_server = (LoginServer)session.activate ("etc/login");
      Login login = new Login (login_server);
      login.authenticate (user, password, null);
      
      this.serviceURL = serviceURL;
      this.sessionName = sessionName;
      this.objectName = objectName;
    } catch (Exception e) {
      e.printStackTrace ();
    }
  }

  public void run () {
    try {
      this.yield ();

      // Get handle to the TX-Factory
      AuroraTransactionService.initialize (ic, serviceURL + "/" + sessionName);

      // create an instance of an employee object in the session
      EmployeeHome employee_home = (EmployeeHome)ic.lookup (serviceURL + "/" + 
sessionName + objectName);

      Employee employee = employee_home.create ();

      System.out.println ("employee_home.create () DONE in " + sessionName);

      EmployeeInfo info = null;

      // start the transaction
      TS.getTS ().getCurrent ().begin ();

      // get the info about an employee
      // Note: lock is set on the row using 'for update' clause while select 
operation
      info = employee.getEmployeeForUpdate ("SCOTT");
      System.out.println ("Beginning salary = " + info.salary + "  in " + 
sessionName);

      // arbitrarily change the value of the salary, e.g. depending on 
sessionName
      if (sessionName.endsWith ("0")) {
	System.out.println ("10% Increase" + sessionName);
	info.salary += (info.salary * 10) / 100;
      } else if (sessionName.endsWith ("1")) {
	System.out.println ("20% Increase" + sessionName);
	info.salary += (info.salary * 20) / 100;
      } else {
	System.out.println ("30% Decrease" + sessionName);
	info.salary -= (info.salary * 30) / 100;
      }

      // try sleeping this-thread for a while before updating the info
      // Note: the other threads MUST wait (since selected with 'for update' 
clause)
      this.sleep (2000);

      // update the infomation in the transaction
      employee.updateEmployee (info);

      // get and print the info in the transaction
      // Note: doNOT use 'for update' here
      info = employee.getEmployee ("SCOTT");
      System.out.println ("End salary = " + info.salary + "  in " + 
sessionName);

      // commit the changes
      TS.getTS ().getCurrent ().commit (true);
    } catch (Exception e) {
      e.printStackTrace ();
    }
  }
}

employee/Employee.java

package employee;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;

import java.sql.*;

public interface Employee extends EJBObject  
{
  public EmployeeInfo getEmployee (String name) throws RemoteException;
  public EmployeeInfo getEmployeeForUpdate (String name) throws RemoteException;

  public void updateEmployee (EmployeeInfo employee) throws RemoteException;
}

employee/EmployeeHome.java

package employee;

import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import java.rmi.RemoteException;

public interface EmployeeHome extends EJBHome
{
  public Employee create () throws RemoteException, CreateException;
}

employee/EmployeeInfo.java

package employee;

import java.rmi.*;

public class EmployeeInfo implements java.io.Serializable {
	public String name = null;
	public int number = 0;
	public double salary = 0;
}

employeeServer/EmployeeBean.sqlj

package employeeServer;

import employee.*;

import javax.ejb.SessionBean;
import javax.ejb.CreateException;
import javax.ejb.SessionContext;
import java.rmi.RemoteException;

import java.sql.*;

public class EmployeeBean implements SessionBean
{
  // Methods of the Employee interface
  public EmployeeInfo getEmployee (String name) throws RemoteException {
    try {
      int empno = 0;
      double salary = 0.0;
      #sql { select empno, sal into :empno, :salary from emp
	            where ename = :name };

			EmployeeInfo info = new EmployeeInfo ();
			info.name = name;
			info.salary = salary;
			info.number = empno;
			return info;
    } catch (SQLException e) {
      // throw new SQLError (e.getMessage ());
    }
		return null;
  }

  public EmployeeInfo getEmployeeForUpdate (String name) throws RemoteException 
{
    try {
      int empno = 0;
      double salary = 0.0;
      #sql { select empno, sal into :empno, :salary from emp
	            where ename = :name for update };

			EmployeeInfo info = new EmployeeInfo ();
			info.name = name;
			info.salary = salary;
			info.number = empno;
	System.out.println ("name = " + name + "  salary = " + salary);
			return info;
    } catch (SQLException e) {
      // throw new SQLError (e.getMessage ());
    }
		return null;
  }

  public void updateEmployee (EmployeeInfo employee) throws RemoteException {
    try {
      #sql { update emp set ename = :(employee.name), sal = :(employee.salary)
								 where empno = :(employee.number) };
    } catch (SQLException e) {
      // throw new SQLError (e.getMessage ());
    } 
		return;
	}

  // Methods of the SessionBean
  public void ejbCreate () throws RemoteException, CreateException {}
  public void ejbRemove() {}
  public void setSessionContext (SessionContext ctx) {}
  public void ejbActivate () {}
  public void ejbPassivate () {}
}

serversideJTS

Client.java

import employee.Employee;
import employee.EmployeeHome;
import employee.EmployeeInfo;

import oracle.aurora.jndi.sess_iiop.ServiceCtx;

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Hashtable;

public class Client
{
  public static void main (String[] args) throws Exception {
    if (args.length != 4) {
      System.out.println ("usage: Client serviceURL objectName user password");
      System.exit (1);
    }
    String serviceURL = args [0];
    String objectName = args [1];
    String user = args [2];
    String password = args [3];

    // create InitialContext
    Hashtable env = new Hashtable ();
    env.put (Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put (Context.SECURITY_PRINCIPAL, user);
    env.put (Context.SECURITY_CREDENTIALS, password);
    env.put (Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    Context ic = new InitialContext (env);

    System.out.println ("Initial Context set up");

    // get handle to the employee object
    System.out.println ("begin ic.lookup (" + serviceURL + objectName + ")");
    EmployeeHome employee_home = (EmployeeHome)ic.lookup (serviceURL + 
objectName);

    System.out.println ("begin employee_home.create ()");
    Employee employee = employee_home.create ();

    EmployeeInfo info = employee.getEmployee ("SCOTT");
    System.out.println ("Beginning salary = " + info.salary);

    // do work on the info-object
    info.salary += (info.salary * 10) / 100;

    // call update on the server-side
    employee.updateEmployee (info);

    System.out.println ("End salary = " + info.salary);
  }
}

employee.ejb

SessionBean employeeServer.EmployeeBean
{
  BeanHomeName = "test/myEmployee";
  RemoteInterfaceClassName = employee.Employee;
  HomeInterfaceClassName = employee.EmployeeHome;

  AllowedIdentities = { PUBLIC };
  RunAsMode = CLIENT_IDENTITY;
  TransactionAttribute = TX_BEAN_MANAGED;
}

employee/Employee.java

package employee;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;

import java.sql.*;

public interface Employee extends EJBObject  
{
  public EmployeeInfo getEmployee (String name)
       throws RemoteException, SQLException;

  public void updateEmployee (EmployeeInfo employee)
       throws RemoteException, SQLException;
}

employee/EmployeeHome.java

package employee;

import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import java.rmi.RemoteException;

public interface EmployeeHome extends EJBHome
{
  public Employee create () throws RemoteException, CreateException;
}

employee/EmployeeInfo.java

package employee;

import java.rmi.*;

public class EmployeeInfo implements java.io.Serializable {
  public String name = null;
  public int number = 0;
  public double salary = 0;

  public EmployeeInfo (String name, int number, double salary) {
    this.name = name;
    this.number = number;
    this.salary = salary;
  }
}

employeeServer/EmployeeBean.sqlj

package employeeServer;

import employee.*;

import javax.ejb.SessionBean;
import javax.ejb.CreateException;
import javax.ejb.SessionContext;
import javax.jts.UserTransaction;

import java.rmi.RemoteException;
import java.sql.*;

public class EmployeeBean implements SessionBean
{
  SessionContext ctx;

  // Methods of the Employee interface
  public EmployeeInfo getEmployee (String name) 
       throws RemoteException, SQLException 
  {
    ctx.getUserTransaction ().begin ();
    
    int empno = 0;
    double salary = 0.0;
    #sql { select empno, sal into :empno, :salary from emp
                  where ename = :name };
    return new EmployeeInfo (name, empno, salary);
  }

  public void updateEmployee (EmployeeInfo employee) 
       throws RemoteException, SQLException
  {
    #sql { update emp set ename = :(employee.name), sal = :(employee.salary)
   	          where empno = :(employee.number) };

    ctx.getUserTransaction ().commit ();
  }

  // Methods of the SessionBean
  public void ejbCreate () throws RemoteException, CreateException {}
  public void ejbRemove() {}
  public void setSessionContext (SessionContext ctx) {
    this.ctx = ctx;
  }
  public void ejbActivate () {}
  public void ejbPassivate () {}
}

serversideLogging

client.java

import employee.Employee;
import employee.EmployeeHome;
import employee.EmployeeInfo;

import oracle.aurora.jndi.sess_iiop.ServiceCtx;

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Hashtable;

public class Client {
  public static void main (String[] args) throws Exception {
    if (args.length != 4) {
      System.out.println 
	("usage: Client serviceURL objectName user password");
      System.exit (1);
    }
    String serviceURL = args [0];
    String objectName = args [1];
    String user = args [2];
    String password = args [3];

    // create InitialContext
    Hashtable env = new Hashtable ();
    env.put (Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put (Context.SECURITY_PRINCIPAL, user);
    env.put (Context.SECURITY_CREDENTIALS, password);
    env.put (Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    Context ic = new InitialContext (env);

    // get handle to the employee object
    System.out.println ("begin ic.lookup (" + serviceURL + objectName + ")");
    EmployeeHome employee_home = (EmployeeHome)ic.lookup 
                                                (serviceURL + objectName);

    System.out.println ("begin employee_home.create ()");
    Employee employee = employee_home.create ();

    EmployeeInfo info = employee.getEmployeeForUpdate ("SCOTT");
    System.out.println ("Beginning salary = " + info.salary);

    // do work on the info-object
    info.salary += (info.salary * 10) / 100;

    // call update on the server-side
    employee.updateEmployee (info);

    // re-query for the info object
    EmployeeInfo newInfo = employee.getEmployee ("SCOTT");
    System.out.println ("End salary = " + newInfo.salary);
  }
}

employee.ejb

// This the generic database work bean template

SessionBean employeeServer.EmployeeBean {
  BeanHomeName = "test/myEmployee";
  RemoteInterfaceClassName = employee.Employee;
  HomeInterfaceClassName = employee.EmployeeHome;

  AllowedIdentities = { PUBLIC };
  RunAsMode = CLIENT_IDENTITY;
  TransactionAttribute = TX_BEAN_MANAGED;

  /*
  SessionTimeout = 10;
  StateManagementType = STATEFUL_SESSION;

  EnvironmentProperties {
    prop1 = value1;
    prop2 = "value two";
  }

  public java.lang.String getEmployee () 
    throws RemoteException, SQLException 
  { 
    TransactionAttribute = TX_BEAN_MANAGED;
    RunAsMode = CLIENT_IDENTITY;      
    AllowedIdentities = { PUBLIC };
  }

  public java.lang.String updateEmployee () 
    throws RemoteException, SQLException 
  { 
    TransactionAttribute = TX_BEAN_MANAGED;
    RunAsMode = CLIENT_IDENTITY;      
    AllowedIdentities = { PUBLIC };
  }
  */
}

log.sql

drop table log_table cascade constraints;

create table log_table (when date, which number, who number, what 
varchar2(2000));
exit

employee/Employee.java

package employee;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;

import java.sql.*;

public interface Employee extends EJBObject  
{
  public EmployeeInfo getEmployee (String name)
       throws RemoteException, SQLException;

  public EmployeeInfo getEmployeeForUpdate (String name) 
       throws RemoteException, SQLException;

  public void updateEmployee (EmployeeInfo employee)
       throws RemoteException, SQLException;
}

employee/EmployeeHome.java

package employee;

import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import java.rmi.RemoteException;

public interface EmployeeHome extends EJBHome
{
  public Employee create () throws RemoteException, CreateException;
}

employee/EmployeeInfo.java

package employee;

import java.rmi.*;

public class EmployeeInfo implements java.io.Serializable {
  public String name = null;
  public int number = 0;
  public double salary = 0;

  public EmployeeInfo (String name, int number, double salary) {
    this.name = name;
    this.number = number;
    this.salary = salary;
  }
}

employeeServer/EmployeeBean.sqlj

package employeeServer;

import employee.*;
import loggingServer.Logging;
import loggingServer.LoggingHome;

import javax.ejb.SessionBean;
import javax.ejb.CreateException;
import javax.ejb.SessionContext;
import javax.jts.UserTransaction;

import java.rmi.RemoteException;
import java.sql.*;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Hashtable;

public class EmployeeBean implements SessionBean 
{
  SessionContext ctx;
  Logging logServer = null;

  // Methods of the Employee interface
  public EmployeeInfo getEmployee (String name) 
       throws RemoteException, SQLException 
  {
    ctx.getUserTransaction ().begin ();

    int empno = 0;
    double salary = 0.0;
    #sql { select empno, sal into :empno, :salary from emp
                  where ename = :name };

    ctx.getUserTransaction ().commit ();

    return new EmployeeInfo (name, empno, salary);
  }

  public EmployeeInfo getEmployeeForUpdate (String name) 
       throws RemoteException, SQLException 
  {
    ctx.getUserTransaction ().begin ();
    
    int empno = 0;
    double salary = 0.0;
    logServer.log ("EJB: getEmployeeForUpdate (" + name + ")");
    #sql { select empno, sal into :empno, :salary from emp
                  where ename = :name for update };
    return new EmployeeInfo (name, empno, salary);
  }

  public void updateEmployee (EmployeeInfo employee) 
       throws RemoteException, SQLException
  {
    logServer.log ("EJB: updateEmployee (" + employee.name + ")");
    #sql { update emp set ename = :(employee.name), sal = :(employee.salary)
   	          where empno = :(employee.number) };

    ctx.getUserTransaction ().commit ();
  }

  // Methods of the SessionBean
  public void ejbCreate () throws RemoteException, CreateException 
  {
    try {
      // create InitialContext
      Hashtable env = new Hashtable ();
      env.put (Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
      Context ic = new InitialContext (env);

      // Now, to create the loggingBean
      String objectName = new String ("/test/loggingService");
      LoggingHome logBean_home = 
	(LoggingHome)ic.lookup ("sess_iiop://thisServer" + objectName);

      logServer = logBean_home.create ();
    } catch (NamingException e) {
      e.printStackTrace ();
    }

    try {
      logServer.log ("EJB: Create Employee");
    } catch (SQLException e) {
      e.printStackTrace ();
    }
  }
  public void ejbRemove () {}
  public void setSessionContext (SessionContext ctx) {
    this.ctx = ctx;
  }
  public void ejbActivate () {}
  public void ejbPassivate () {}
}

loggingServer/Logging.java

package loggingServer;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;

import java.sql.*;

public interface Logging extends EJBObject {
  public void log (String message) throws RemoteException, SQLException;
}

loggingServer/LoggingBean.sqlj

package loggingServer;

import javax.ejb.*;
import java.rmi.RemoteException;

import java.sql.*;

import oracle.aurora.rdbms.DbmsJava;
import oracle.aurora.rdbms.Schema;

public class LoggingBean implements SessionBean {
  SessionContext ctx;

  public void log (String message) throws RemoteException, SQLException {
    int ownerNumber = Schema.currentSchema ().ownerNumber ();
    // System.out.println ("ownerNumber = " + ownerNumber);

    // get the session-id
    int sessID = DbmsJava.sessionID (DbmsJava.USER_SESSION);

    #sql { insert into log_table (who, which, when, what) values 
                        (:ownerNumber, :sessID, sysdate, :message) };
  }

  public void ejbCreate () throws RemoteException, CreateException {}
  public void ejbRemove () {}
  public void setSessionContext (SessionContext ctxArg) {
    ctx = ctxArg;
  }
  public void ejbActivate () {}
  public void ejbPassivate () {}
}

loggingServer/LoggingHome.Java

package loggingServer;

import javax.ejb.*;
import java.rmi.RemoteException;

public interface LoggingHome extends EJBHome {
  public Logging create () throws RemoteException, CreateException;
}

loggingServer/LogBean.ejb

// This the generic database work bean template

SessionBean loggingServer.LoggingBean {
  BeanHomeName = "test/loggingService";
  RemoteInterfaceClassName = loggingServer.Logging;
  HomeInterfaceClassName = loggingServer.LoggingHome;

  TransactionAttribute = TX_REQUIRES_NEW;
  RunAsMode = CLIENT_IDENTITY;      
  AllowedIdentities = { PUBLIC };

  EnvironmentProperties {
    prop1 = value1;
    prop2 = "value two";
  }
}




Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index