ORMQueryExecutionException

Posts   
 
    
Posts: 27
Joined: 23-Mar-2012
# Posted on: 01-Mar-2017 02:41:42   

Hi all,

I'm having an exception while trying to using transaction.

{"An exception was caught during the execution of an action query: Unknown column 'pulsamkios.SD' in 'where clause'. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."}

this is my innerException StackTrace :

   at Devart.Data.MySql.bi.a()
   at Devart.Data.MySql.bi.i()
   at Devart.Data.MySql.ag.a(ac[]& A_0, Int32& A_1, Boolean A_2)
   at Devart.Data.MySql.ag.a(Byte[] A_0, Int32 A_1, Boolean A_2, String A_3)
   at Devart.Data.MySql.i.e()
   at Devart.Data.MySql.i.m()
   at Devart.Data.MySql.MySqlCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords)
   at Devart.Common.DbCommandBase.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Devart.Common.DbCommandBase.ExecuteNonQuery()
   at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Query\ActionQuery.cs:line 231

This happened after i change my database structure and do refresh relational model data from a database.

From this Exception Message :

{"An exception was caught during the execution of an action query: Unknown column 'pulsamkios.SD' in 'where clause'. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."}

Made me confuse since pulsamkios table doesn't have SD field. It had it before i structuring the database.

this is my code regarding this Exception :

MasterfakturmkiosEntity objMasterfakturmkiosEntity = new MasterfakturmkiosEntity();
                    ResellerEntity objResellerEntity = new ResellerEntity(txtKodeReseller.Text);

                    objMasterfakturmkiosEntity.NomorFakturMkios = GetMaxNomorNota();
                    objMasterfakturmkiosEntity.Reseller = objResellerEntity;
                    objMasterfakturmkiosEntity.KodePengguna = "USR001";
                    objMasterfakturmkiosEntity.Tanggal = DateTime.Now;

                    
                    for (int i = 0; i < gridPenjualanMkios.Rows.Count; i++)
                    {
                        if (gridPenjualanMkios.Cells[i, "JumlahJual"].Value != null)
                        {
                            DetailfakturmkiosEntity objDetailfakturmkiosEntity = new DetailfakturmkiosEntity();
                            objDetailfakturmkiosEntity.NomorFakturMkios = objMasterfakturmkiosEntity.NomorFakturMkios;
                            objDetailfakturmkiosEntity.KodePulsa = gridPenjualanMkios.Cells[i, "Kode Pulsa"].Text;
                            objDetailfakturmkiosEntity.JumlahJual = Convert.ToInt32(gridPenjualanMkios.Cells[i, "JumlahJual"].Value);
                            objDetailfakturmkiosEntity.HargaBeli = Convert.ToInt32(gridPenjualanMkios.Cells[i, "Harga Beli"].Value);
                            objDetailfakturmkiosEntity.Harga = Convert.ToInt32(gridPenjualanMkios.Cells[i, "Harga"].Value);

                                                       objMasterfakturmkiosEntity.Detailfakturmkios.Add(objDetailfakturmkiosEntity);
                        }
                    }
                    objMasterfakturmkiosEntity.Save(true);

my code using transaction to save Master & Detai of an invoice. I had use TransactionManager before and the Exception raised was the same.

Also, where is the location of

c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Query\ActionQuery.cs:line 231

How to solve this? Please let me know if you guys need additional info regarding this Exception.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 01-Mar-2017 07:07:35   

Maybe the SD field still exists in your persistence classes.

  • Is the field still in your model? (Can you see the field in the entity in you LLBLGen Designer?) If so check the following project setting:

**Remove unmapped elements after refresh **When set to true, any element which doesn't have a mapping after a catalog refresh is removed from the project. Default is false. The value Default means the value in the preferences is used.

  • Also check that you actually regenerated the code and it's in latest version.
David Elizondo | LLBLGen Support Team
Posts: 27
Joined: 23-Mar-2012
# Posted on: 01-Mar-2017 07:27:03   

daelmo wrote:

Maybe the SD field still exists in your persistence classes.

  • Is the field still in your model? (Can you see the field in the entity in you LLBLGen Designer?) If so check the following project setting:

**Remove unmapped elements after refresh **When set to true, any element which doesn't have a mapping after a catalog refresh is removed from the project. Default is false. The value Default means the value in the preferences is used.

  • Also check that you actually regenerated the code and it's in latest version.

Thanks for the reply daelmo.

Yes, i had remove unmapped elements before ask to the forum.

Something weird is going on. I think is is related to my mySQL itself. When i tried to add the row manually in master table and then in detail table using a mySQL editor, it shows the same exception message :

unknown column pulsamkios.SD in where clause

this just happen when i tried to add the row manually or by insert statement to detail table. For the master table, add row manually contain no error message.

Is there any procedure to check mySQL "internal error"?

Posts: 27
Joined: 23-Mar-2012
# Posted on: 01-Mar-2017 07:43:17   

Sorry, turn out its because of trigger. the trigger i created using old database structure. and it had pulsamkios.SD column related.

After few hours turn out that happen because of small thing. I had rewrite the trigger and it is okay right now.

anybody had problem like this before?

sometime when write an application, we tend to see the "bigger problem" while the solution is just a minor things we dont try to solve.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 01-Mar-2017 17:24:52   

anybody had problem like this before?

These things happen, especially that unit tests usually doesn't cover code/logic written in the database.