Why doesn't Derby use the currentShema property from my WAS data source?

I would like to know why the derby does not take into account the currentSchema property defined on this data source (WAS for the current example)?

My problem is exactly the same as Nastya in this post: Omit the schema in the DERBY request But there is no answer to his last comment.

So, I have an application that works in different data sources (the same database, but one schema per data source). I thought Derby would use the currentSchema property defined in the data source if I tell him to use this data source, but all my named queries are executed on the "DEV" schema (database username) instead of the schema defined in my datasource 'property CurrentSchema. I know that the default derby behavior is when no schema is provided with the request, and if the SET CURRENT SCHEMA statement has not been executed before, but ...

Is there any existing solution or upcoming improvement in Derby to solve this use case? (I do not consider this a problem, since Derby was designed to use a scheme for each user, I think)

Thanks in advance for any suggestion.

PS . To understand why I need this: I wrote scripts to automatically configure derby data sources in a developer's workstation (local web panel) so that they could deploy / run their applications in a local database, rather than a common DB2 development. But I would avoid doing the SET CURRENT SCHEMA statement before each query in the application code only to solve this problem ... (performance impact on other real environments) And, of course, I cannot change the local database to use something else. than Derby :)

0
source share
1 answer

I found a solution specific to my use case because the fix was done using the WebSphere configuration.

. SQL- , . SQL-

SET CURRENT SCHEMA MY_SCHEMA

"MY_SCHEMA" .

, , wsadmin, :

  • J2EEResourceProperty 'preTestSQLString' , = SQL
  • ' testConnections "true"

, WebSphere, SQL- , , , EntityManager. , , , ... .

0

All Articles