Attention: Oracle 8i/9i users

Posts   
 
    
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 17-Dec-2004 09:04:26   

In the drivers section, a hotfix for Oracle 8i/9i (ODP.NET) is posted. This hotfix has a completely new foreign key retrieval routine to fix a couple of issues in the old one. This routine uses an SQL query on systen views to retrieve the foreign key constraints, while the old one used OleDb's GetOleDbSchemaTable. The Sql query is much faster and because the routine had to be patched anyway the Sql version was used (The DataDirect version doesn't rely on OleDb that's why the routine was available).

The customer who reported the issue, that should be fixed with this hotfix claims that a lot of the relations in the LLBLGen Pro project are removed after the project is refreshed with the hotfix (So FK constraints are ignored). (so their code doesn't compile anymore). This could be because the routine still contains a bug and rejects foreign key constraints which are valid so the relations based on these foreign key constraints are not re-created after the refresh.

Request Because I can't reproduce the problem with my testdatabases on Oracle 9i, I can't find the problem and because the customer is on the other side of the planet, the debugging effort isn't as efficient as it could be. Because some other bugfixes have to be released as well, I do want to push out a new installer but if the oracle driver is buggy that's not a good idea. So my question to you Oracle users is: does this hotfix driver produce bad results on your systems too? Again: it doesn't remove anything from your db, it apparently seems to ignore some foreign key constraints which leands to the absense of relations between entities.

Bad results are: refreshing the catalog and in the application output window (at the bottom of the llblgen pro window) exceptions are logged, or you refresh the catalog, re-generate code and when you reference that assembly in your own code, it doesn't compile (because Customer.Orders isn't present anymore ...)

Thanks for your time!

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 17-Dec-2004 15:49:37   

Anyone has access to an 8i machine? If so: the following query seems to give different results on 8i than on 9i. On 9i it gives the proper results, but on 8i it seems to give all the constraints not the FK's.

Could someone with access to 8i run this query? thanks. The Query should list all foreign keys by table, sorted: FK table, FK name, field name . Change the string 'schema' with the schema you run the query on, so for example 'schema' is replaced with 'SCOTT'.


SELECT  CCFK.OWNER AS FK_TABLE_SCHEMA, 
        CCFK.TABLE_NAME AS FK_TABLE_NAME, 
        CCFK.COLUMN_NAME AS FK_COLUMN, 
        CCFK.POSITION AS FK_POSITION,
        CCPK.OWNER AS PK_TABLE_SCHEMA, 
        CCPK.TABLE_NAME AS PK_TABLE_NAME, 
        CCPK.COLUMN_NAME AS PK_COLUMN, 
        CCPK.POSITION AS PK_POSITION, 
        C.R_CONSTRAINT_NAME AS FK_NAME 
FROM    ALL_CONS_COLUMNS CCFK, 
        ALL_CONS_COLUMNS CCPK, 
        ALL_CONSTRAINTS C 
WHERE   CCFK.CONSTRAINT_NAME = C.CONSTRAINT_NAME 
        AND CCFK.OWNER = C.OWNER 
        AND C.CONSTRAINT_TYPE='R' 
        AND C.R_CONSTRAINT_NAME = CCPK.CONSTRAINT_NAME 
        AND C.R_OWNER = CCPK.OWNER 
        AND CCFK.OWNER='schema' 
ORDER BY CCFK.TABLE_NAME, C.R_CONSTRAINT_NAME, CCFK.COLUMN_NAME, CCFK.POSITION

Update: It doesn't seem to be different on 8i. ..

Frans Bouma | Lead developer LLBLGen Pro