Problem:
The Naming Service is configured to use Oracle database as a backing store. In addition, the Naming Service cache is enabled for faster performance in retrieving the namespace. However, the SQL queries may block during execution. What is the behavior of the naming service when vbroker.naming.queryTimeout property is applied?
Resolution:
If vbroker.naming.queryTimeout property is not set & a lock has occurred in the query table.
a. When a server attempts to do a rebind or bind call to the Naming Service, the SQL statement to delete and insert the name entry will be blocked.
b. As the properties vbroker.naming.cacheOn=1 is set, the Naming Service will update its cache with the new server reference.
c. The client can continue to resolve from the Naming Service cache.
d. When the lock is released, the Naming Service will update the backend JDBC database.
If vbroker.naming.queryTimeout property is set & a lock has occurred in the query table.
a. When the timeout has not expired, the behavior is similar to the former scenario described above.
b. When the timeout expired, a SQLException should be thrown by the Oracle driver.
It depends on the version of the Oracle driver used. The test result is done using Oracle Database 11g Release 1 (11.1.0.7.0) JDBC Drivers ojdbc6_g.jar and a SQLException is thrown. However, another set of test conducted using Oracle 10G JDBC driver will hang and no SQL exception is seen. Oracle has released a bug fix. BUG-3479558 - Expiration of query timeout or calling Statement.cancel causes the Thin driver to hang.
c. The SQL state and the error code thrown by Oracle will confirm the database lock on the result set is released. Message: ORA-01013: user requested cancel of current operation SQLState: 72000 ErrorCode: 1013
d. VisiBroker Naming Service will wrap the SQLException & throws CannotProceed exception.
e. Application need to either catch & handle the exception or to restart the server application to rebind to the Naming Service again.
f. It will not impact the client from resolving existing server references in the Naming Service.
a. When a server attempts to do a rebind or bind call to the Naming Service, the SQL statement to delete and insert the name entry will be blocked.
b. As the properties vbroker.naming.cacheOn=1 is set, the Naming Service will update its cache with the new server reference.
c. The client can continue to resolve from the Naming Service cache.
d. When the lock is released, the Naming Service will update the backend JDBC database.
If vbroker.naming.queryTimeout property is set & a lock has occurred in the query table.
a. When the timeout has not expired, the behavior is similar to the former scenario described above.
b. When the timeout expired, a SQLException should be thrown by the Oracle driver.
It depends on the version of the Oracle driver used. The test result is done using Oracle Database 11g Release 1 (11.1.0.7.0) JDBC Drivers ojdbc6_g.jar and a SQLException is thrown. However, another set of test conducted using Oracle 10G JDBC driver will hang and no SQL exception is seen. Oracle has released a bug fix. BUG-3479558 - Expiration of query timeout or calling Statement.cancel causes the Thin driver to hang.
c. The SQL state and the error code thrown by Oracle will confirm the database lock on the result set is released. Message: ORA-01013: user requested cancel of current operation SQLState: 72000 ErrorCode: 1013
d. VisiBroker Naming Service will wrap the SQLException & throws CannotProceed exception.
e. Application need to either catch & handle the exception or to restart the server application to rebind to the Naming Service again.
f. It will not impact the client from resolving existing server references in the Naming Service.
#VisiBroker
#Oracle
#NamingService
#Security
#queryTimeout