Hi  Jennie,

Thanks for your reply. please find my replies below:

Jennie Commented: Concurrent insertion into two different tables should work.  Do you have anymore information about why the COMMIT has failed?  Maybe the problem lies somewhere else than concurrent insertions?

Shiva's Comment: yes when I run two batch file by clicking it with difference of second ( as it takes few seconds to click the second batch file) and it runs perfectly, even I have tried running copy command directly on the monetsql client and on two clients in parallel it works perfectly. Is there some configuration change required on monetdb server?

Jennie Commented: - Have you tried the two COPY INTO separately?  To know if the problem is indeed caused by concurrent insertions.

Shiva's Comment:  When I am trying with two separate java program running concurrently its throwing same exception.


Jennie Comment: - Does the problem occur one-time, or every time you repeatedly execute your code?
Shiva's Comment: Yes the same error message is coming every time I run concurrent java programs with copy command in it ( here copying data to different tables ).

Any help will be really appreciated.

Thank you.

Shivanandan Gupta.
 

Date: Fri, 13 Mar 2015 15:36:23 +0800

From: Ying Zhang <Y.Zhang@cwi.nl>
To: Communication channel for MonetDB users <users-list@monetdb.org>
Cc: martin@monetdb.org
Subject: Re: Multi threaded (2 threads) Java program for copy command
Message-ID: <89A66109-B083-45A4-B59E-62B7AF0C9D86@cwi.nl>
Content-Type: text/plain; charset=us-ascii


> On Mar 12, 2015, at 19:27, Shivanandan Gupta <shivnandangupta@gmail.com> wrote:
>
> Hi Martin,
>
> Thanks for your prompt reply , I am using two different tables here but still  I am getting "Exception in thread "main" java.sql.SQLException: COMMIT: failed"   exception.

Hello Shivanandan,

Concurrent insertion into two different tables should work.  Do you have anymore information about why the COMMIT has failed?  Maybe the problem lies somewhere else than concurrent insertions?

- Have you tried the two COPY INTO separately?  To know if the problem is indeed caused by concurrent insertions.
- Does the problem occur one-time, or every time you repeatedly execute your code?

Regards,

Jennie



On Thu, Mar 12, 2015 at 4:57 PM, Shivanandan Gupta <shivnandangupta@gmail.com> wrote:
Hi Martin,

Thanks for your prompt reply , I am using two different tables here but still  I am getting "Exception in thread "main" java.sql.SQLException: COMMIT: failed"   exception.



Message: 2
Date: Thu, 12 Mar 2015 08:32:31 +0100
From: Martin Kersten <martin@monetdb.org>
To: users-list@monetdb.org
Subject: Re: Multi threaded (2 threads) Java program for copy command
        commit fails for one thread
Message-ID: <5501410F.1070508@monetdb.org>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hi,

Yes. Insertion into the same table would be invalidated due to the transaction semantics.
See https://www.monetdb.org/Documentation/Manuals/SQLreference/Transactions