This is a migrated thread and some comments may be shown as answers.

HighLowKeyGenerator no table

6 Answers 141 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nikolai Hellwig
Top achievements
Rank 1
Nikolai Hellwig asked on 23 Apr 2010, 02:27 PM
hi,

I set the <ext.db-key-generator.ignoreMissingTables>True</ext.db-key-generator.ignoreMissingTables> parameter.
But when i open a connection i always get an "table or view does not exist error" in the HighLowRelationalKeyGenerator.init() function.
How can i avoid testing for table existence?
Is there a way to globally disable KeyGeneration?

I am using the 2010 Q1 Version of OpenAccess.

6 Answers, 1 is accepted

Sort by
0
Nikolai Hellwig
Top achievements
Rank 1
answered on 28 Apr 2010, 08:42 PM
still no solution.

how can i figure out which table is requested. i have create a table voa_keygen with no success.
is there a way to log the sql command. Trace shows nothing. IObjectScope.Log can't be set, cause the exeception happens in the scope init process.

any help would be great
nikolai
0
Zoran
Telerik team
answered on 29 Apr 2010, 02:59 PM
Hi Nikolai Hellwig,

 Can you give us more insight about your project? What is the reason that you set that setting in your app.config? Are you using forward or reverse mapping? If you have classes that are mapped to tables that have no primary keys, then the HighLow key generator is used, and the voa_keygen table is being requested by the runtime. The important rule you must consider with OpenAccess is that all your tables must have primary keys set, so if you have tables where it is not, it is not recommended to just work around the HighLow key generator? Are your tables having a Primary Key? If you are using forward mapping, have you set the primary key field, or is OpenAccess doing that for you by using the HighLow key generator and an internal field? We are looking forward to for further collaboration on this so we can understand your problem better and find a decent solution for you.

All the best,
Zoran
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Nikolai Hellwig
Top achievements
Rank 1
answered on 29 Apr 2010, 07:27 PM
the project consists of 3 c#-projects
1. Data Model with ObjectScopeClass
2. Data Access Layer (with custom modifications)
3. WPF Client

We are using Reverse Mapping of an Oracle Database 10g Express (11 Tables, 3 Views).
Each Table has a primary key. We have generated a pseudo pkey for all 3 views too.

I've set the app.config property because we have sequences, which generate ids at insert. so we don't need any generated primary keys by openaccess.


0
Nikolai Hellwig
Top achievements
Rank 1
answered on 29 Apr 2010, 08:46 PM
i figured something out.

openaccess is executing the following sql statement:

select "table_name", "last_used_id" from "voa_keygen"

which cause a table not found exception in sql-plus. oracle is case-sensitive when using double-quotes.

what oracle needs is:
select table_name, last_used_id from voa_keygen

i.e. without ".

thx

0
Nikolai Hellwig
Top achievements
Rank 1
answered on 29 Apr 2010, 09:16 PM
okay, now i have a solution.

i don't know why, but i had an [Telerik.OpenAccess.Persistent()] annotation to my IObjectScopeProvider implementation.
i removed it and now everything works fine.

thx
Nikolai Hellwig
CHW Software GmbH
0
Zoran
Telerik team
answered on 04 May 2010, 08:34 AM
Hello Nikolai Hellwig,

 We are glad you have solved your problem. The reason for the behavior has been that Persistent attribute on the ObjectScopeProvider class. OpenAccess treats the class as it uses a HighLowKeyGenerator and tries to get the identity for this class from the voa_keygen table. If any other issues arise in the future, please do not hesitate to contact us back.

Best wishes,
Zoran
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Development (API, general questions)
Asked by
Nikolai Hellwig
Top achievements
Rank 1
Answers by
Nikolai Hellwig
Top achievements
Rank 1
Zoran
Telerik team
Share this question
or