DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: shanyu zhao
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Datanucleus cannot find table in SQL Server with fully qualified name

Created: 10/Sep/13 04:48 AM   Updated: 23/Oct/13 11:56 AM   Resolved: 10/Oct/13 10:34 AM
Component/s: Queries
Affects Version/s: 3.2.6, 3.2.7
Fix Version/s: 3.2.7

File Attachments: 1. Text File NUCRDBMS-692.patch (3 kB)

Datastore: Microsoft SQL Server
Severity: Production

 Description  « Hide
Recent change in Datanucleus uses fully qualified name to access database objects, which is in the form of <catalog>.<schema>.<object>. However, the schema name for SQL Server has been historically set to empty string "". Therefore the fully qualified name for a SQL Server object is something like "mycatlog..mytable". With this however it cannot find an existing table in the database.

This problem demonstrates in Apache Hive bug HIVE-5218:

Sort Order: Ascending order - Click to sort in descending order
shanyu zhao added a comment - 10/Sep/13 04:52 AM
A fix attached. Basically I'm using SCHEMA_NAME() to get the current schema name. As described here:

I've verified that with this fix, the HIVE-5218 cannot be reproduced anymore (is fixed by this fix).

Andy Jefferson added a comment - 08/Oct/13 08:54 PM
Your patch is invalid since it will fail when someone is using earlier than SQLServer 2005. So you need to add a check on max/min version (or similar) and if 2005+ then use your code, otherwise use old code.

Andy Jefferson added a comment - 10/Oct/13 10:34 AM
SVN trunk has a form of this "patch", with check on version of SQLServer based on web search. Totally untested, and nobody else with SQLServer has reported a problem so likely minority interest