Private Oracle synonym for a sequence is not prefixed with a schema name

Posts   
 
    
Kazak1
User
Posts: 39
Joined: 30-May-2006
# Posted on: 30-May-2006 19:51:28   

I am having a problem with a private synonym for a sequence when it is used to generate PK values.

Say, I have a table and a sequence in USER1 schema:

USER1.TABLE1 USER1.SEQUENCE1

I created private synonyms for both objects in schema USER2.

I created another user USER3 and granted him full access to the synonyms in USER2 schema.

I created an LLBLGen project, connected as USER2, and added an entity mapped on USER2.TABLE1 synonym. I associated the sequence's synonym with the PK of the USER2.TABLE1.

Now, in my application, I am connecting as USER3. When I try to add a record to TABLE1, I receive an error when executing the following query:

SELECT SEQUENCE1.NEXTVAL FROM DUAL

SEQUENCE1 must be prefixed with USER2 schema as it is a private synonym. It looks like LLBLGen assumes that all sequences' synonyms are public and omits schema names.

Adapter Scenario Designer: 1.0.2005.1 Final February 19, 2006 SD.LLBLGen.Pro.ORMSupportClasses.NET11: 1.0.2005.1 .NEt 1.1 VS.NET 2003

Thanks, Mikhail

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 31-May-2006 11:28:51   

It should include the schema name as well. Could you try the latest llblgen pro version from the customer area?

The issue you run into is fixed in 1.0.2004.2 during the beta, so it's strange you run into it with a later version of 1.0.2005.1.

The sequences in the designer, in the entity editor, are they specified as schema.sequencename or just sequencename? Because that's the name used in the query.

Frans Bouma | Lead developer LLBLGen Pro
Kazak1
User
Posts: 39
Joined: 30-May-2006
# Posted on: 31-May-2006 19:03:35   

I am using version 1.0.2005.1 Final from February 19, 2006.

Sequences' synonyms do not include the schema name in the designer. However, I can see the other sequences that belong to the USER2 schema with USER2 prefix.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 31-May-2006 20:18:13   

So the synonym sequences are not prefixed by a schema name in your list. I'll see if I can repro that.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 01-Jun-2006 14:29:18   

It's indeed a bug in the driver. It doesn't prefix a synonym sequence with the owner of the synonym. The catalog refresher also doesn't set the sequence name to the correct name after this has been fixed so the fix contains 2 parts: - Oracle driver - designer fix.

Fixed in next build of the designer/drivers

Frans Bouma | Lead developer LLBLGen Pro