Column specified more than once in SET clause

4 posts, 0 answers
  1. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 30 Jul 2012 Link to this post

    We are using the latest version of OpenAccess. We are using a vertical inheritance strategy in our model. When trying to add an object, we get the following exception:

    Telerik.OpenAccess.RT.sql.SQLException : The column name 'AssetId' is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name 'AssetId' may appear twice in the view definition. Statement(s) could not be prepared.

    Telerik.OpenAccess.Exceptions.DataStoreException: Insert of '777647279-d9b59293-819d-4835-bdf4-f2674d6f6388' failed: Telerik.OpenAccess.RT.sql.SQLException: The column name 'AssetId' is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name 'AssetId' may appear twice in the view definition.
    Statement(s) could not be prepared.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
       at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
       at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)
    INSERT INTO [Users] ([AssetId], [EmailAddress], [FirstName], [LastName], [OrganizationId], [AssetId]) VALUES (?, ?, ?, ?, ?, ?)
    (set event logging to all to see parameter values) Telerik.OpenAccess.RT.sql.SQLException: The column name 'AssetId' is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name 'AssetId' may appear twice in the view definition.
    Statement(s) could not be prepared.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
       at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
       at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes) ---> Telerik.OpenAccess.RT.sql.SQLException: The column name 'AssetId' is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name 'AssetId' may appear twice in the view definition.
    Statement(s) could not be prepared.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
       at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
       at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)
       --- End of inner exception stack trace ---
       at OpenAccessRuntime.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x, Boolean needsRollback)
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.internalCommit(Boolean phase)
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.commit()
       at VirtualOffice.Controllers.UserController.CreateUser(Guid pOrganizationId, String pEmail, String pFirstName, String pLastName, Boolean pCreatePendingConfirmation) in C:\inetpub\wwwroot\VirtualOffice\Common Libraries\VirtualOffice.Controllers\UserController.cs:line 131
       at Controls_ConfirmTokenInvitation.CreateUser(String pEmail, String pPassword, String pFirstName, String pLastName, Boolean pIsShadowUser) in c:\inetpub\wwwroot\VirtualOffice\Web\Portal\Controls\ConfirmToken.ascx.cs:line 112
       at Controls_ConfirmTokenInvitation.OnConfirmInviteClick(Object sender, EventArgs e) in c:\inetpub\wwwroot\VirtualOffice\Web\Portal\Controls\ConfirmToken.ascx.cs:line 96

    We've tried using the association editor to explicitly set all relations, but that doesn't seem to be working. Here is a link the zip containing the RLINQ file.

    https://s3.amazonaws.com/SolidCloud-misc/EntityDiagrams.zip

    Any help would be appreciated.
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 02 Aug 2012 Link to this post

    Hello Chris,

     We reproduced the issue you reported and it looks like a bug on our side when there is a 1:1 association and Vertical inheritance. The 1:1 association between the User and PendingConfirmation objects is the reason for this exception. We are still working on the issue and I will update you later if we could find a workaround for you at the moment. Thanks a lot for reporting this to us. We wil get back to you as soon as we have clearer view on the problem and its possible solutions.

    Kind regards,
    Zoran
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. DevCraft banner
  4. Chris
    Chris avatar
    40 posts
    Member since:
    Feb 2009

    Posted 02 Aug 2012 Link to this post

    Thank you so much! We are trying to avoid rolling back to a previous build as much as possible :)
  5. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 07 Aug 2012 Link to this post

    Hello Chris,

     Unfortunately there is no workaround for this bug at the moment, it is a limitation of our 1:1 implementation that one entity can't be in two 1:1 relationships (one created by the vertical inheritance mapping and one normal 1:1 association). We will remove this limitation for our Q3 release though and will even try to push it for as soon as our following internal build.

    All the best,
    Zoran
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Back to Top