Bug #76544 Insert, update records in multiple java threads with ClusterJ api
Submitted: 31 Mar 2015 11:35 Modified: 16 Sep 16:31
Reporter: Arco van der Velden Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster/J Severity:S2 (Serious)
Version:7.3.8 Win x64 OS:Microsoft Windows
Assigned to: Bogdan Kecman CPU Architecture:Any
Tags: cluster, ClusterJ, java, multiple threads

[31 Mar 2015 11:35] Arco van der Velden
Description:
I'm trying to insert and update records in three tables using multiple java threads and using the ClusterJ java api.
The result of my test is not all records are inserted and not all updates are performed while the insert and updates are in the same transaction.
Each java thread uses his own connection object obtained from SessionFactory
ClusterJDatastoreException (because of possible duplicate inserts) is catched and in that case rollback is called and the transaction is performed again.
No exceptions occur but like said before not all records are inserted and updated.

How to repeat:
Java classes can be provided if needed.
[31 Mar 2015 11:47] Arco van der Velden
Database

Attachment: DatabaseSchema.sql (application/octet-stream, text), 2.31 KiB.

[31 Mar 2015 11:47] Arco van der Velden
FixTradeInterface

Attachment: FixTradeDataInterface.java (application/octet-stream, text), 5.01 KiB.

[31 Mar 2015 11:48] Arco van der Velden
FixTradeFacade

Attachment: FixTradeFacade.java (application/octet-stream, text), 3.72 KiB.

[31 Mar 2015 11:48] Arco van der Velden
InstructionsFacade

Attachment: InstructionsFacade.java (application/octet-stream, text), 1.42 KiB.

[31 Mar 2015 11:48] Arco van der Velden
PositionsFacade

Attachment: PositionsFacade.java (application/octet-stream, text), 1.41 KiB.

[31 Mar 2015 11:48] Arco van der Velden
PositionsInterface

Attachment: PositionsInterface.java (application/octet-stream, text), 766 bytes.

[31 Mar 2015 11:49] Arco van der Velden
ThreadClass

Attachment: ThreadClass.java.txt (text/plain), 4.74 KiB.

[31 Mar 2015 11:49] Arco van der Velden
Source files are attached.
[2 Apr 2015 12:44] Arco van der Velden
Can anybody please have a look at this, this issue is blocking further development of our application.
[16 Sep 16:31] Bogdan Kecman
Hi,

What you reported I cannot reproduce. Most probably you are not properly handling threads. From the sample code you attached I can't see how you are creating connection objects and that has to happen in each thread (and is not from what I'm guessing from code sample you provided). This is why I believe this is not a bug but that you need consulting in how to properly use cluster/J and for that I strongly suggest you contact our Support Team.

kind regards