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

Vertical Mapping and DataStoreException

1 Answer 46 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.
Aaron Drenberg
Top achievements
Rank 1
Aaron Drenberg asked on 17 Jul 2010, 02:22 PM

Hi,

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.

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 19 Jul 2010, 06:14 PM
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:
 
<backendconfigurations>
  <backendconfiguration id="mssqlConfiguration" backend="mssql">
    ...
        <dbDisablePsCache>true</dbDisablePsCache>
    ...
  </backendconfiguration>
</backendconfigurations>

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.

Regards,
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
Tags
Development (API, general questions)
Asked by
Aaron Drenberg
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or