Classloading Optimizations for Resource Adapters Connection Optimizations

17 Tuning Resource Adapters 17-1 17 Tuning Resource Adapters This appendix describes some best practices for resource adapter developers. ■ Section 17.1, Classloading Optimizations for Resource Adapters ■ Section 17.2, Connection Optimizations ■ Section 17.3, Thread Management ■ Section 17.4, InteractionSpec Interface

17.1 Classloading Optimizations for Resource Adapters

You can package resource adapter classes in one or more JAR files, and then place the JAR files in the RAR file. These are called nested JARs. When you nest JAR files in the RAR file, and classes need to be loaded by the classloader, the JARs within the RAR file must be opened and closed and iterated through for each class that must be loaded. If there are very few JARs in the RAR file and if the JARs are relatively small in size, there will be no significant performance impact. On the other hand, if there are many JARs and the JARs are large in size, the performance impact can be great. To avoid such performance issues, you can either: 1. Deploy the resource adapter in an exploded format. This eliminates the nesting of JARs and hence reduces the performance hit involved in looking for classes. 2. If deploying the resource adapter in exploded format is not an option, the JARs can be exploded within the RAR file. This also eliminates the nesting of JARs and thus improves the performance of classloading significantly.

17.2 Connection Optimizations

Oracle recommends that resource adapters implement the optional enhancements described in sections 7.14.2 and 7.14.2 of the J2CA 1.5 Specification at http:java.sun.comj2eeconnectordownload.html . Implementing these interfaces allows WebLogic Server to provide several features that will not be available without them. Lazy Connection Association, as described in section 7.14.1, allows the server to automatically clean up unused connections and prevent applications from hogging resources. Lazy Transaction Enlistment, as described in 7.14.2, allows applications to start a transaction after a connection is already opened. 17-2 Performance and Tuning for Oracle WebLogic Server

17.3 Thread Management