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

Invalid column name 'voa_version'

2 Answers 308 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cristian Apavaloaiei
Top achievements
Rank 2
Cristian Apavaloaiei asked on 26 Oct 2010, 10:45 AM
I'm getting this error when trying to return a table mapped using reverse mapping. The problem is that i don't have a column named 'voa_version' and can't find it defined anywhere in the rlinq file. 

This is the exact exception:

{"Error executing query: Telerik.OpenAccess.RT.sql.SQLException: Invalid column name 'voa_version'.\r\nStatement(s) could not be prepared.\r\n   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()\r\n   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()\r\n   at OpenAccessRuntime.Relational.fetch.FetchResultImp.execute()\nSQL:\nSELECT  TOP(??T) a.[Pk_ProdusID] AS COL1, a.[Descriere] AS COL2, a.[Logo] AS COL3, a.[Nume] AS COL4, a.[voa_version] AS COL5 FROM [Produse] a WHERE a.[Nume] = ?                Telerik.OpenAccess.RT.sql.SQLException: Invalid column name 'voa_version'.\r\nStatement(s) could not be prepared.\r\n   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()\r\n   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()\r\n   at OpenAccessRuntime.Relational.fetch.FetchResultImp.execute()"}

Any ideas why OpenAccess thinks that this table has a column named 'voa_version'?

2 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 28 Oct 2010, 06:03 AM
Hello Cristian Apavaloaiei,

It seems that you are using a Version Concurrency Mode for the Produse persistent type, but you did not set a concurrency member for this class(it is probably set to (AUTO)). When the concurrency member is not explicitly specified the OpenAccess' runtime tries to use a default one which is mapped to the "voa_version" column. In your case, this column does not exist on the database server(this approach is usual for forward mapping scenarios where OpenAccess creates this column for you). There are three approaches you could use in this scenario in order to avoid the error:
1. Set the concurrency member:
- Select the persistent type from the dsl designer;
- Specify a Concurrency Member from the Properties window;
2. Change the Concurrency Mode to Default or Changed from the Properties window;
3. Use the Update Schema from Model wizard to add the "voa_version" column on the database server. Helpful information regarding the wizard can be found here and here.
Hope that helps.

Greetings,
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
0
Cristian Apavaloaiei
Top achievements
Rank 2
answered on 28 Oct 2010, 11:37 AM
This solved my problem, thank you.

I created the table using reverse mapping, and the table included a timestamp column. The problem appeared when i removed the timestapm column from the mapped entity (duh...).

Thanks again
Tags
General Discussions
Asked by
Cristian Apavaloaiei
Top achievements
Rank 2
Answers by
Damyan Bogoev
Telerik team
Cristian Apavaloaiei
Top achievements
Rank 2
Share this question
or