Vertical Mapping and DataStoreException

Thread is closed for posting
2 posts, 0 answers
  1. Aaron Drenberg
    Aaron Drenberg avatar
    7 posts
    Member since:
    Jan 2010

    Posted 17 Jul 2010 Link to this post


    I've got a class called 'Comments', and a class called 'CommentReplies'. They are both derived from an abstract 'BaseComment' class. There is also a 'User' class with properties (and backing fields) for 'Comments' and 'CommentReplies'.

    I'm using a vertical mapping strategy, so I've got a 'base_comments' table, a 'comments' table and a 'comment_replies' table.

    In my 'User' class, the 'Comments' property throws an exception of type DataStoreException. The message is "Could not find prepared statement with handle -1".

    When using a flat mapping strategy this works fine, by the way. It's only when I try to use a vertical mapping strategy that I encounter problems. It seems to be because the inverse field 'user_id' is only present in the 'base_comments' table and not the 'comments' table. I thought Open Access would take into account the reference columns in a base table when using a vertical mapping strategy.

    Can I please have some more information on why this might be occurring, and what to do about it? I'd like to see if I can get it to work using a vertical mapping strategy. Thanks.
  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 19 Jul 2010 Link to this post

    Hi Aaron Drenberg,

    It seems to be an issue with the prepared statements which Telerik OpenAccess uses. They are cached in the connection pools. This caching mechanism can be disabled from the backend configuration section using the following setting:
      <backendconfiguration id="mssqlConfiguration" backend="mssql">

    If you are using the DSL designer you could make this setting from the Model Settings dialog under the Backend Settings | Connection Pool section. You could run the Model Settings dialog by right-clicking on the designer surface and choosing Show Model Settings dialog....
    Hope that helps.

    Damyan Bogoev
    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