For components deployed to a cluster, you can configure request and response logging to avoid duplicate calls to business methods. These repeated calls might occur when the client has failed over from one server to another, and is uncertain whether the call was successfully executed on the first server before failure.
Request logging can prevent repeated calls to methods that return void. Enable request logging by calling the <requestLog> command inside a <setProperties> command that configures your component.
Response logging can prevent repeated calls to methods that return a value (not void). Enable request logging by calling the <responseLog> command inside a <setProperties> command that configures your component.
Request and response logging uses the af_response_log database table in the cluster.db data source. Request and response logging will normally degrade performance due to the use of a database. However, there use is appropriate if possible duplication of method calls is unacceptable.
The following example shows how to configure automatic failover, request logging, and response logging from an Ant user-configuration script:
<setProperties component="ejb.components.myjar.MyCompRemote"> <automaticFailover enable="true"/> <requestLog enable="true"/> <responseLog enable="true"/> </setProperties>
The <setProperties> component attribute specifies the name of the DJC component that runs the application component that you want to monitor. Set this depending on the application component type, as follows:
For enterprise JavaBeans components, specify the DJC component that corresponds to the remote interface. You can read the DJC component names from the EJB module’s Ant configuration file that was generated by deployment.
For CORBA and PowerBuilder components, specify the
DJC component that corresponds to the remote interface of the EJB
session bean that wraps your component. This name is ejb.components.package.componentRemote
,
where package is the CORBA package name, and component is
the component name.