Error On Commit?

4 posts, 0 answers
  1. Sean
    Sean  avatar
    54 posts
    Member since:
    Apr 2008

    Posted 07 Jun 2009 Link to this post

    I came back to an old personal project and updated the ORM to the latest release. Now when I commit() the objct it throws an error.
    here is the code:

               readonly IObjectScope sc = AQDataContext.GetNewObjectScope();
               sc.Transaction.Begin();

                var tGame = new Tblgame();
                var descrip = HttpUtility.HtmlEncode(txtDescription.Text);
                var added = HttpUtility.HtmlEncode(txtAdditional.Text);
                tGame.DateSubmitted = DateTime.Now;
                tGame.Description = descrip;
                tGame.Additional = added;
                tGame.GameName = txtGameName.Text;
                tGame.IsLurkable = chkLurker.Checked ? true : false;
                tGame.NumberOfPlayers = int.Parse(txtPlayerCount.Text);
                tGame.RefereeId = CurrentUser.UserId;
                tGame.RulesId = int.Parse(ddlRules.SelectedValue);
                tGame.Status = "Awaiting Approval";
                tGame.IsPublic = chkPublic.Checked ? true : false;

                try
                {
                    sc.Add(tGame);
                    sc.Transaction.Commit(); //ERROR IS HERE
                }
                catch (Exception ex)
                {
                    throw new Exception("Error in game submission", ex);
                }

    Here is the error stack trace:

    [SQLException: Not implemented yet: setAsciiStream]   Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.SQLException(String s) +55   Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.NotImplementedYet(String t) +48   Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.setAsciiStream(Int32 parameterIndex, Stream x, Int32 length) +37   OpenAccessRuntime.Relational.conn.PooledPreparedStatement.setAsciiStream(Int32 parameterIndex, Stream x, Int32 length) +52   OpenAccessRuntime.Relational.sql.conv.AsciiStreamConverter.setValue(PreparedStatement ps, Int32 index, RelationalColumn col, Object value_Renamed) +201   OpenAccessRuntime.Relational.RelationalGenericState.setParams(PreparedStatement ps, Int32[] stateFieldNos, Int32 firstFieldNo, Int32 lastFieldNo, Int32 firstParam, PersistGraph pGraph, Int32 tableNo) +445   OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes) +2099[DataStoreException: Error setting parameters on PreparedStatement for insert of '1541616495-0':Telerik.OpenAccess.RT.sql.SQLException: Not implemented yet: setAsciiStream   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.SQLException(String s)   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.NotImplementedYet(String t)   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.setAsciiStream(Int32 parameterIndex, Stream x, Int32 length)   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.setAsciiStream(Int32 parameterIndex, Stream x, Int32 length)   at OpenAccessRuntime.Relational.sql.conv.AsciiStreamConverter.setValue(PreparedStatement ps, Int32 index, RelationalColumn col, Object value_Renamed)   at OpenAccessRuntime.Relational.RelationalGenericState.setParams(PreparedStatement ps, Int32[] stateFieldNos, Int32 firstFieldNo, Int32 lastFieldNo, Int32 firstParam, PersistGraph pGraph, Int32 tableNo)   at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)INSERT INTO `tblgames` (`Additional`, `AllowsMultiplePC`, `DateClosed`, `DateSubmitted`, `Description`, `GameId`, `GameName`, `IsLurkable`, `IsPublic`, `NumberOfPlayers`, `RefereeId`, `RulesId`, `Status`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)(set event logging to all to see parameter values) Telerik.OpenAccess.RT.sql.SQLException: Not implemented yet: setAsciiStream   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.SQLException(String s)   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.NotImplementedYet(String t)   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.setAsciiStream(Int32 parameterIndex, Stream x, Int32 length)   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.setAsciiStream(Int32 parameterIndex, Stream x, Int32 length)   at OpenAccessRuntime.Relational.sql.conv.AsciiStreamConverter.setValue(PreparedStatement ps, Int32 index, RelationalColumn col, Object value_Renamed)   at OpenAccessRuntime.Relational.RelationalGenericState.setParams(PreparedStatement ps, Int32[] stateFieldNos, Int32 firstFieldNo, Int32 lastFieldNo, Int32 firstParam, PersistGraph pGraph, Int32 tableNo)   at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)]   Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28   Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +34   OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x) +1455   OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.internalCommit(Boolean phase) +582   OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.commit() +188   OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.commit() +42   Telerik.OpenAccess.RT.TransactionImpl.Commit() +115   AgoraQuest.Members.NewGame.btnSubmit_Click(Object sender, EventArgs e) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AgoraQuest\AgoraQuest\Members\NewGame.aspx.cs:55[Exception: Error in game submission]   AgoraQuest.Members.NewGame.btnSubmit_Click(Object sender, EventArgs e) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\AgoraQuest\AgoraQuest\Members\NewGame.aspx.cs:60   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    Thanks for any help. I can't submit a ticket or I would ask there. :)

    Sean 
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 08 Jun 2009 Link to this post

    Hi Sean ,
    This has been fixed in the latest custom build. You can find the custom build in your download area.

    Regards,
    Jan Blessenohl
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Sean
    Sean  avatar
    54 posts
    Member since:
    Apr 2008

    Posted 09 Jun 2009 Link to this post

    Thanks for the fix, Jan.

    Now I have a second issue. :)

    The transaction commits the record to the database, but when i try to retrieve the record ID (I need this for a mapping table insert) the value returned is 0.

    As such:
    1    try 
    2             { 
    3                 sc.Add(tGame); 
    4                 sc.Transaction.Commit(); 
    5                  
    6                 sc.Transaction.Begin(); 
    7                 var id = sc.GetObjectId(tGame); //This is always '0'
    8                 tUserGame.GameId = int.Parse(id.ToString()); 
    9                 tUserGame.UserId = tUser.UserId; 
    10                 tUserGame.RoleId = tRole.RoleId; 
    11                 sc.Add(tUserGame); 
    12                 sc.Transaction.Commit(); 
    13  
    14             } 
    15             catch (Exception ex) 
    16             { 
    17                 throw new Exception("Error in game submission", ex); 
    18             } 

             
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 09 Jun 2009 Link to this post

    Hi Sean ,
    var id is an IObjectId instance. Can you tell me what id.ToString() and Database.Oid.ToString(id) really returns?

    Kind regards,
    Jan Blessenohl
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top