Closed kbMetrel closed 9 months ago
Hello @kbMetrel ,
Do you think you could create a runnable project with the issue? It doesn’t need to be your project, just a new solution with the minimum code to reproduce the issue.
We tried on our side but we are not able to reproduce it.
What we especially want to know is more how you use the BulkInsert
and the Transaction
. So, we believe the project will give us some additional hints that we are missing that could explain the current error.
Best Regards,
Jon
Hi Jon!
Sure. Attaching the project.... I added CreateDb.txt for how the Postgres Table is created...
Hope that helps! DemoApp.zip
Hello @kbMetrel ,
Thank you for the project.
The error happen because the table
name is not escaped in the CreateDB.txt
script. So when the following command is executed CREATE TABLE IF NOT EXISTS SerialsToWebCdId
, the table name created is all in lowercase: serialstowebcdid
And in your mapping, you specify the same table name DapperPlusManager.Entity<DbSerial>().Table("SerialsToWebCdId")
, but on our side, we escape it.
So to fix it, you can either:
CREATE TABLE IF NOT EXISTS "SerialsToWebCdId"
.Table("serialstowebcdid")
On our side, we indeed have an error by not showing the right message error when this situation happen within a transaction. We will fix it on our side, so the next time it will be easiest to know that the table name doesn't match.
Let me know if that explain correctly the cause and how to solve this issue.
Best Regards,
Jon
Heh, yeah!
@JonathanMagnan, thanks for the feedback! It works like a charm! :)
Will be buying the license! :)
Best regards,
Karl
Description
Trying to use BulkInsert on Postgres 16.1. Using settings
var context = new DapperPlusContext(conn, tran); context.Entity<DbSerial>().Table("SerialsToWebCdId").Identity(x => x.Id, true);
Orconst string MappingKey = "ForDocumentDetailsBulkInsert"; DapperPlusManager.Entity<DbSerial>(MappingKey).Table("SerialsToWebCdId").Identity(x => x.Id);
OrDapperPlusManager.Entity<DbSerial>().Table("SerialsToWebCdId").Identity(x => x.Id, true);
When Executing conn.BulkInsert getting an error: An error occured while retrieving the InformationSchemaTable informationException
If you are seeing an exception, include the full exceptions details (message and stack trace).