HighLowKeyGenerator no table

7 posts, 0 answers
  1. Nikolai Hellwig
    Nikolai Hellwig avatar
    16 posts
    Member since:
    Mar 2010

    Posted 23 Apr 2010 Link to this post

    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.
  2. Nikolai Hellwig
    Nikolai Hellwig avatar
    16 posts
    Member since:
    Mar 2010

    Posted 28 Apr 2010 Link to this post

    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
  3. DevCraft banner
  4. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 29 Apr 2010 Link to this post

    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.
  5. Nikolai Hellwig
    Nikolai Hellwig avatar
    16 posts
    Member since:
    Mar 2010

    Posted 29 Apr 2010 Link to this post

    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.


  6. Nikolai Hellwig
    Nikolai Hellwig avatar
    16 posts
    Member since:
    Mar 2010

    Posted 29 Apr 2010 Link to this post

    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

  7. Nikolai Hellwig
    Nikolai Hellwig avatar
    16 posts
    Member since:
    Mar 2010

    Posted 29 Apr 2010 Link to this post

    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
  8. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 04 May 2010 Link to this post

    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.
Back to Top
DevCraft banner