Hi,
we have tested the LLBLGen 4.2 and PostgreSQL with JSON and JSONB support. Fields are generated as string which is acceptable and fetching the records works fine. The problem occures when we try to save the entity with JSONB field type:
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of an action query: ERROR: 42804: column "Json" is of type jsonb but expression is of type character varying. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> Npgsql.NpgsqlException: ERROR: 42804: column "Json" is of type jsonb but expression is of type character varying
at Npgsql.NpgsqlState.<ProcessBackendResponses>d__1.MoveNext()
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject(Boolean cleanup)
at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription()
at Npgsql.ForwardsOnlyDataReader.NextResultInternal()
at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean preparedStatement, NpgsqlRowDescription rowDescription)
at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb)
at Npgsql.NpgsqlCommand.ExecuteNonQuery()
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
--- End of inner exception stack trace ---
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.ExecuteActionQuery(IActionQuery queryToExecute)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.PersistQueue(List
1 queueToPersist, Boolean insertActions)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>n__FabricatedMethodf5(IEntity2 , Boolean , IPredicateExpression , Boolean )
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>c__DisplayClassf3.<SaveEntity>b__f2()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteWithActiveRecoveryStrategy[T](Func`1 toExecute)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.SaveEntity(IEntity2 entityToSave)
We have tested the Npgsql driver and he has a support for JSON/JSONB so updating the record with ADO.NET using the driver works properly. In order for this to work properly we had to set the parameter type to NpgsqlTypes.NpgsqlDbType.Jsonb.
Can you let us know when can we expect this bug to be fixed ? Any ETA will be appreciated.
Regards