SQL/MX Programming Manual for Java

SQL/MX Programming Considerations
HP NonStop SQL/MX Programming Manual for Java523726-003
4-40
Long-Running UPDATE STATISTICS Operations and
TMF Errors
To ensure that DML statements use updated histogram statistics:
Put embedded UPDATE STATISTICS statements in a separate program from
dependent DML statements.
Run the UPDATE STATISTICS statements before compiling an SQLJ program that
refers to related tables.
Long-Running UPDATE STATISTICS Operations and TMF Errors
When you run an SQLJ program that contains an UPDATE STATISTICS statement,
JDBC/MX always starts a transaction during the preparation of the UPDATE
STATISTICS statement. The UPDATE STATISTICS statement runs under the inherited
transaction.
Long-running UPDATE STATISTICS operations could exceed the TMF autoabort time.
When this situation occurs, TMF returns errors. See the Transaction Management
Facility (TMF) Introduction for details.
To avoid problems, embed an UPDATE STATISTICS statement in an SQLJ program
only if you expect the UPDATE STATISTICS operation to complete before the TMF
autoabort time. Otherwise, run the UPDATE STATISTICS statement from MXCI.
Publish/Subscribe Services
SQLJ programs allow embedded DML statements to include extensions that support
transactional queuing and publish/subscribe services. Publish/subscribe services allow
applications to receive immediate notification of changes to the database at less cost
to the system. For information about publish/subscribe functionality, see the SQL/MX
Queuing and Publish/Subscribe Services manual.
For examples of publish/subscribe functionality in SQLJ programs, see Appendix C,
Sample Programs.
Note. In the current release of SQL/MX, SQLJ programs do not support rowsets to enqueue or
dequeue multiple rows at one time.