IBM Support

Is the Toolbox JDBC driver threadsafe?

Question & Answer


Question

Is the Toolbox JDBC driver threadsafe?

Answer

In Version 5 Release 1, JTOpen 2.0, or later: Yes. All public Toolbox JDBC objects are threadsafe and can be shared between multiple threads.
In Toolbox Modification 3 (Version 4 Release 5), JTOpen 1.0, and previous versions: Yes and no. A Connection object is threadsafe and can be shared between threads without the need for additional synchronization. A Statement object is NOT threadsafe, and unexpected results can occur if multiple threads access the same Statement object. We suggest that multiple threads can share the same Connection, but should each create their own Statement.
Regardless of which version you are using, be aware that IBM i database cursors are scoped to an entire Connection object. If your Java program calls a stored procedure which creates a cursor and returns a ResultSet, it will not be threadsafe, even if you use separate CallableStatement objects in each thread.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Product Synonym

IBM i

Document Information

Modified date:
17 March 2020

UID

ibm11117989