LLBLGen Pro v2.6 Self-Servicing Simple Insert Failing

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 29-Sep-2009 21:44:34   

Hi all,

I am unable to insert into a table, and I'm getting the following exception:

"Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."

The query is:


Method Enter: CreateSingleTargetInsertDQ
Generated Sql query: 
    Query: INSERT INTO [MyDb].[sms].[MOMessages] ([MessageID], [SMSClientID], [ID], [Message], [IP], [ReceiveTime], [EntryTime], [MessageTypeID])  VALUES (@MessageID, @SMSClientID, @ID, @Message, @IP, @ReceiveTime, @EntryTime, @MessageTypeId);SELECT @MOMessageID=SCOPE_IDENTITY()
    Parameter: @MOMessageID : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Output. Value: <undefined value>.
    Parameter: @MessageID : Guid. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: b2fb8ca8-387b-4c33-9848-4d02395b950e.
    Parameter: @SMSClientID : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 1044.
    Parameter: @ID : AnsiString. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: "0001".
    Parameter: @Message : AnsiString. Length: 2147483647. Precision: 0. Scale: 0. Direction: Input. Value: "Hello World!".
    Parameter: @IP : AnsiString. Length: 15. Precision: 0. Scale: 0. Direction: Input. Value: "127.0.0.1".
    Parameter: @ReceiveTime : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 9/29/2009 3:42:50 PM.
    Parameter: @EntryTime : DateTime. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 9/29/2009 3:42:54 PM.
    Parameter: @MessageTypeId : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 1.


Method Exit: CreateSingleTargetInsertDQ
Method Exit: CreateInsertDQ
Method Enter: DaoBase.ExecuteActionQuery
A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.NET20.DLL

Has anyone seen this error before?

This is occuring with SQL Server 2005 w/ Service Pack 3.

If I run the query in Enterprise Manager without parameters it works OK:


INSERT INTO [myDB].[sms].[MOMessages] ([MessageID], [SMSClientID], [ID], [Message], [IP], [ReceiveTime], [EntryTime], [MessageTypeID])  
VALUES ('{51529E4D-29B0-4e73-AA00-EF39095A5B8C}', '1044', '12345', 'HELLO WORLD!', '127.0.0.1', '9/29/2009 3:48:42 PM', '9/29/2009 3:48:49 PM', '1');
SELECT SCOPE_IDENTITY()

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 29-Sep-2009 22:42:20   

Hi

Please could you supply us with the full information as detailed in this thread.

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7722

Also, if you are not using the latest version, please could you download and try that.

Thanks

Matt

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 29-Sep-2009 22:43:59   

MTrinder wrote:

Hi

Please could you supply us with the full information as detailed in this thread.

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7722

Also, if you are not using the latest version, please could you download and try that.

I just downloaded the latest release - no joy.

Here's the exception part of the DQE:

Method Exit: CreateSingleTargetInsertDQ Method Exit: CreateInsertDQ Method Enter: DaoBase.ExecuteActionQuery A first chance exception of type 'SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException' occurred in SD.LLBLGen.Pro.ORMSupportClasses.NET20.DLL

It's dying on this line:


        ''' <summary>Performs the insert action of a new Entity to the persistent storage.</summary>
        ''' <returns>true if succeeded, False otherwise</returns>
        Protected Overrides Overloads Function InsertEntity() As Boolean
            Dim dao As MOmessageDAO = CType(CreateDAOInstance(), MOmessageDAO)
            Return dao.AddNew(MyBase.Fields, MyBase.Transaction)
        End Function

Stack Trace:


   at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
   at SD.LLBLGen.Pro.ORMSupportClasses.BatchActionQuery.Execute()
   at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteActionQuery(IActionQuery queryToExecute, ITransaction containingTransaction)
   at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.AddNew(IEntityFields fields, ITransaction containingTransaction)
   at MyCompany.MyProduct.Core.SMS.DAL.EntityClasses.MOmessageEntity.InsertEntity() in c:\Projects\MyCompany.MyProduct.Core.SMS\MyCompany.MyProduct.Core.SMS.DAL\EntityClasses\MOmessageEntity.vb:line 426
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.CallInsertEntity()
   at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PersistQueue(List`1 queueToPersist, Boolean insertActions, ITransaction transactionToUse, Int32& totalAmountSaved)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase`1.PerformSaveMulti(Boolean recurse)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase`1.SaveMulti(Boolean recurse)

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 29-Sep-2009 22:46:36   

Ok - could you please let us know the rest of the info detailed in above thread. The particularly important bits are the stack trace and the full text of the exception.

Googling seems to reveal that this is actually a SQL server error that is being raised up through the LLBLGen code, and there are lots of different causes - so as much info as possible would be useful...

Thanks

Matt

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 29-Sep-2009 22:47:59   

MTrinder wrote:

Ok - could you please let us know the rest of the info detailed in above thread. The particularly important bits are the stack trace and the full text of the exception.

Googling seems to reveal that this is actually a SQL server error that is being raised up through the LLBLGen code, and there are lots of different causes - so as much info as possible would be useful...

That was the full text of the exception ... sorry I was in the middle of adding the stack trace when you replied.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 29-Sep-2009 22:48:25   

What is the type of your message field ? And if you change it to a nvarchar(200), refresh, regenerate and re-run, does it then work...? Some of the causes seemed to be related to text/ntext fields...

Matt

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 29-Sep-2009 22:57:07   

mshe wrote:

MTrinder wrote:

Ok - could you please let us know the rest of the info detailed in above thread. The particularly important bits are the stack trace and the full text of the exception.

Googling seems to reveal that this is actually a SQL server error that is being raised up through the LLBLGen code, and there are lots of different causes - so as much info as possible would be useful...

That was the full text of the exception ... sorry I was in the middle of adding the stack trace when you replied.

I thought the message had got bigger - thanks !

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 29-Sep-2009 23:13:05   

Thanks for the hints! I got it to work.

Yes it was indeed due to my Message column being varchar(max).

The fix was to either:

  1. Change the column to not be MAX

or

  1. Change the SQL Server compatiblity level to 90.