[Mono-list] Batch inserts with ADO.NET

Rob.Tillie@Student.tUL.EDU Rob.Tillie@Student.tUL.EDU
Sat, 22 May 2004 16:25:58 +0200


Hello,

I don't believe this is supported in the ADO.NET drivers, but
you can send multiple queries at once by pasting them together, e.g.:

INSERT1; INSERT2; INSERT3; ... etc.

This is effectively what the J/Connector driver does, as batch =
statements
are not supported until MySql 4.1.

Greetz,
-- Rob.

-----Original Message-----
From: Fredrik Hedberg [mailto:fredrik.hedberg@hedbergs.com]=20
Sent: Saturday, May 22, 2004 1:29 PM
To: Daniel Morgan
Cc: mono-list@lists.ximian.com
Subject: RE: [Mono-list] Batch inserts with ADO.NET

What I would like to do in ADO.NET (any provider, spec DB2) is what we
would do with executeBatch in JDBC, for example

PreparedStatement statement =3D connection.prepareStatement("INSERT
INTO....");
                       =20
            for (int i =3D 0; i < 1000; i++)
            {
                    statement.setInt(1,rand.nextInt());
                    statement.addBatch();
            }
            statement.executeBatch();

But, when running inserts without batching (iterate and execute
statement) in mono my memory usage goes way of and while mono --profile
reports used mem about 40MB, linux swaps about 800MB. Why the
difference? Am I writing crappy code or just the GC freaking out? And
how should i implement the above code in mono?

/Fred

l=F6r 2004-05-22 klockan 03.38 skrev Daniel Morgan:
> You need to provide more information, such as, what data provider are
> you using?  A simple test case would help too. =20
>=20
> -----Original Message-----
> From: mono-list-admin@lists.ximian.com
> [mailto:mono-list-admin@lists.ximian.com] On Behalf Of Fredrik =
Hedberg
> Sent: Friday, May 21, 2004 10:01 AM
> To: mono-list@lists.ximian.com
> Subject: [Mono-list] Batch inserts with ADO.NET
>=20
>=20
> Hi,=20
>=20
> What would be the best way do do batch inserts (like jdbc prepared
> statement) with ADO.NET. Currently while doing larger data inserts =
(1M
> and more) I'm experiencing some serious performance issues (related =
to
> memleaks in native/managed wrapper?). How does other people solve =
this?
>=20
> Fred
>=20
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>=20
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list