Using multiple COPY INTO inside a transaction from Java

Hi, We are already using the COPY INTO bulk insert from Java via BufferedMCLWriter, as you suggest in your recipes bookhttps://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/LoadingBulkData, and based in the examplehttp://dev.monetdb.org/hg/MonetDB/file/tip/java/example/SQLcopyinto.java you provided. I understood that each COPY INTO behaves as a single transaction. My question now is if there is a way to group two or more COPY INTO and make them behave as a single transaction. Thank you Gerardo

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 17/11/15 23:04, Gerardo Blanco wrote:
Hi,
We are already using the COPY INTO bulk insert from Java via BufferedMCLWriter, as you suggest in your recipes book <https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/LoadingBul kData>,
and based in the example
<http://dev.monetdb.org/hg/MonetDB/file/tip/java/example/SQLcopyinto.j ava>
you provided.
I understood that each COPY INTO behaves as a single transaction. My question now is if there is a way to group two or more COPY INTO and make them behave as a single transaction.
Turn off autocommit using the appropriate JDBC call (setAutoCommit(false)). After you're done, call commit() (or rollback() if you don't want to commit).
Thank you
Gerardo
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
- -- Sjoerd Mullender -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEbBAEBCAAGBQJWTDYxAAoJEISMxT6LrWYgIZoH+M5rZrMLfq3Xst50nQqDlc6U bNLP9hmK6FN75TOYAHF4uNs9R8DZ5HswkvaqXY7xzeCU9AE6gBAeD2hT8YfW16El PqP5VxFiKlYqdS1cDjIetSQSVbb4yZP2SxF5D0q6Vi7ISM7jaTDM5syhNl66gfq/ uUYi5f9m1gMLc4kXfoDLFJdXVhpnve/mBLthzTcknNle8LBbc4gRNfpd064+eCID vz8d06l/p3TdMPETxJEG+5X0wwUe4nTRzsAmFe+itrKUPNPgiyCO56vyY0igcbmM wzJS61C+mQLQmTEHI6qXb946RndI4PeDiV4IMKQeNVRcZDy2nJT7t6k1e9qAKA== =Y6VP -----END PGP SIGNATURE-----

Hi Sjoerd,
I supposed that the JDBC connection (Connection con, as per the example
http://dev.monetdb.org/hg/MonetDB/file/tip/java/example/SQLcopyinto.java)
and the one obtained vía the socket (invoking server.connect on MapiSocket
server) where the COPY INTO takes place, were independent, in the sense
that any change to the auto-commit made from the JDBC connection would have
no effect on the actions inside the MapiSocket connection.
But, according to what you say the changes to the auto-commit mode take
effect on the thread where they are invoked, and affect any actions inside
this thread (be it COPY INTO or JDBC statement executions).
Please confirm if I understood correctly.
Regards
Gerardo
2015-11-18 5:26 GMT-03:00 Sjoerd Mullender
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 17/11/15 23:04, Gerardo Blanco wrote:
Hi,
We are already using the COPY INTO bulk insert from Java via BufferedMCLWriter, as you suggest in your recipes book <https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/LoadingBul kData>,
and based in the example
<http://dev.monetdb.org/hg/MonetDB/file/tip/java/example/SQLcopyinto.j ava>
you provided.
I understood that each COPY INTO behaves as a single transaction. My question now is if there is a way to group two or more COPY INTO and make them behave as a single transaction.
Turn off autocommit using the appropriate JDBC call (setAutoCommit(false)). After you're done, call commit() (or rollback() if you don't want to commit).
Thank you
Gerardo
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
- -- Sjoerd Mullender -----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQEbBAEBCAAGBQJWTDYxAAoJEISMxT6LrWYgIZoH+M5rZrMLfq3Xst50nQqDlc6U bNLP9hmK6FN75TOYAHF4uNs9R8DZ5HswkvaqXY7xzeCU9AE6gBAeD2hT8YfW16El PqP5VxFiKlYqdS1cDjIetSQSVbb4yZP2SxF5D0q6Vi7ISM7jaTDM5syhNl66gfq/ uUYi5f9m1gMLc4kXfoDLFJdXVhpnve/mBLthzTcknNle8LBbc4gRNfpd064+eCID vz8d06l/p3TdMPETxJEG+5X0wwUe4nTRzsAmFe+itrKUPNPgiyCO56vyY0igcbmM wzJS61C+mQLQmTEHI6qXb946RndI4PeDiV4IMKQeNVRcZDy2nJT7t6k1e9qAKA== =Y6VP -----END PGP SIGNATURE----- _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
-- *Gerardo P. Blanco*
participants (3)
-
Gerardo Blanco
-
Gerardo Blanco
-
Sjoerd Mullender