-
Bug
-
Resolution: Done
-
Major
-
12.1.0.Final
-
None
-
None
This may border with a feature request.
Scenario:
When user configures a JDBC cache store, with IBM DB2 as a backing database, but doesn't specify a schema name, the DB2TableManager#tableExists(Connection connection, TableName tableName) call returns true even if the caching table is present in different schema.
In effect the caching table in the current schema is not created and attempt to cache anything fails with SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=dballo14.ispn_entry_cbnc_ear_a_war, DRIVER=4.25.23 error (i.e. table doesn't exist).
For reproduction steps, see JBEAP-21362.
The code that checks the existence of a table looks like this:
DatabaseMetaData metaData = connection.getMetaData(); String schemaPattern = tableName.getSchema(); // <- this is null rs = metaData.getTables(null, schemaPattern, tableName.getName(), new String[]{"TABLE"});
Suggested improvement:
If tableName.getSchema() returns null, the current schema name should be determined and supplied. On DB2 current schema can be obtained with SQL query "VALUES CURRENT SCHEMA".
- is cloned by
-
JBEAP-21362 [QA](7.4.z) ISPN-12930 - Clustering: JDBC store using DB2 DB2 v11.1.1.1 doesn't work anymore
- Closed
-
WFLY-14755 Clustering: JDBC store using DB2 DB2 v11.1.1.1 doesn't work anymore
- Closed
- is incorporated by
-
WFLY-14705 Upgrade Infinispan from 11.0.10.Final to 11.0.11.Final
- Closed