how dotConnect for PostgreSQL work with ibatis.net
Posted: Mon 05 Jul 2010 10:37
i use dotConnect for PostgreSQL in ibatis.net
ibatis.net don't use command prepare method default but
dotConnect for PostgreSQL , PgSqlCommand's property UnpreparedExecute is false default.
so when i execute batch sql will throw exception
batch sql like this:
INSERT INTO "Frm_Dept"("DeptName","ParentId")VALUES('dept1',1);
INSERT INTO "Frm_Dept"("DeptName","ParentId")VALUES('dept2',2);
exception:
Devart.Data.PostgreSql.PgSqlException: cannot insert multiple commands into a prepared statement
at Devart.Data.PostgreSql.v.c(r A_0)
at Devart.Data.PostgreSql.r.af()
at Devart.Data.PostgreSql.PgSqlCommand.InternalPrepare(Boolean implicitPrepare, Int32 startRecord, Int32 maxRecords)
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 IBatisNet.DataMapper.Commands.DbCommandDecorator.System.Data.IDbCommand.ExecuteNonQuery()
ibatis.net don't use command prepare method default but
dotConnect for PostgreSQL , PgSqlCommand's property UnpreparedExecute is false default.
so when i execute batch sql will throw exception
batch sql like this:
INSERT INTO "Frm_Dept"("DeptName","ParentId")VALUES('dept1',1);
INSERT INTO "Frm_Dept"("DeptName","ParentId")VALUES('dept2',2);
exception:
Devart.Data.PostgreSql.PgSqlException: cannot insert multiple commands into a prepared statement
at Devart.Data.PostgreSql.v.c(r A_0)
at Devart.Data.PostgreSql.r.af()
at Devart.Data.PostgreSql.PgSqlCommand.InternalPrepare(Boolean implicitPrepare, Int32 startRecord, Int32 maxRecords)
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 IBatisNet.DataMapper.Commands.DbCommandDecorator.System.Data.IDbCommand.ExecuteNonQuery()