Invalid column name 'voa_version'

3 posts, 0 answers
  1. Cristian Apavaloaiei
    Cristian Apavaloaiei avatar
    25 posts
    Member since:
    Aug 2008

    Posted 26 Oct 2010 Link to this post

    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. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 28 Oct 2010 Link to this post

    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
  3. DevCraft banner
  4. Cristian Apavaloaiei
    Cristian Apavaloaiei avatar
    25 posts
    Member since:
    Aug 2008

    Posted 28 Oct 2010 Link to this post

    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
Back to Top