Debugging Synchronized Systems
Page 2 of 4

The printFailedTransaction Method

Cloudsync provides the COM.cloudscape.synchronization.TransactionListVTI.printFailedTransaction method to extract information on failed transactions from SYSERRORS and present it in a more useful form.

The printFailedTransaction method takes the errorID column of SYSERRORS as a parameter, and returns a ColumnResultSet wrapping the transaction contents of a SYSERRORS row.

The simplest way to use this method is to register it as a method alias and then use it in a SELECT statement against SYSERRORS.

Creating a Method Alias

To register the printFailedTransaction method as an alias, issue the following SQL-J statement:

CREATE METHOD ALIAS printFailedTransaction FOR TransactionListVTI.printFailedTransaction

Using printFailedTransaction

To list all failed transactions in SYSERRORS, issue the following statement:

SELECT printFailedTransaction(errorID) FROM SYS.SYSERRORS

If failed transactions exist, a series of nested result sets are returned. If there are no failed transactions, an empty result set is returned:

SQLCol1
---------------
0 rows selected

You can optionally specify a second argument to modify the width of the SUMMARY columns. If no second argument is specified, SUMMARY columns are 25 characters long. To modify the column width, specify a number as the second argument. For example, if you have long object names, you might issue the following query to increase the column width to 40 characters:

SELECT printFailedTransaction(errorID, 40) FROM SYS.SYSERRORS

Note to Cloudconnector Users

Because the printFailedTransaction method uses nested ResultSets, you should append the following attribute to the Cloudconnector database connection URL:

weblogic.t3.cacheRows=0

This prevents Cloudconnector from pre-fetching the outer ResultSet first. A complete database connection URL might look like the following:

'jdbc:cloudscape:weblogic:sourceDB&weblogic.t3.cacheRows=0'

Since Cloudconnector processes outer nested ResultSets first, failure to specify this corrective attribute causes printFailedTransaction to generate the following error:

ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
ERROR (no SQLState): TransactionListVTI not correctly positioned.