Monday, September 29, 2008

Using 'DirectSQL'

Introduction:
This is a feature of the Database Adapter. Oracle claims that by using it, it will improves the performance. This option is available from 10.1.3 version onwards.
It will let you bypass the TopLink framework, and instead use direct JDBC SQL calls to the database. Well, it will not totally bypass TopLink, it will still be used for generating the SQL, obtaining connections, and table introspection. However, other functions of TopLink, for e.g. the cache option, will not be used under DirectSQL.

Restrictions:
The restrictions that needs to be taken into account are listed below:

1) Only works for flat table structures.
2) For an Inbound Adapter you must have DeletePollingStrategy.
3) For an Outbound Adapter you can only use it with Insert.
4) Limited to work with String, Number, Date, Time, Clob and Blob DataTypes only.
5) Does not work with the DetectOmissions feature.

Configuration:
It is configured in the adapter WSDL file:

<jca:operation
InteractionSpec="oracle.tip.adapter.db.DBWriteInteractionSpec"
DescriptorName="myService.PerfOut"
DmlType="insert"
DetectOmissions="false"
UseDirectSql="true"
OptimizeMerge="true"
MappingsMetaDataURL="myService_toplink_mappings.xml" />

Addition setting:
You must also set DetectOmissions="false", this because DetectOmissions defaults to "true".

No comments: