Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction does not work as expected [moved] #100

Closed
lvca opened this issue Dec 10, 2012 · 0 comments
Closed

Transaction does not work as expected [moved] #100

lvca opened this issue Dec 10, 2012 · 0 comments

Comments

@lvca
Copy link
Member

lvca commented Dec 10, 2012

This is Issue 100 moved from a Google Code project.
Added by 2010-08-13T07:56:46.000Z by emailmat...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Type-Defect, Priority-High, v0.9.22

Original description

<b>What steps will reproduce the problem?</b>
It is possible that I understand the documentation incorrect, in that case please let me know how I can achieve the result I expected. I tried to insert a thousand rows in one transaction:

db.begin(TXTYPE.OPTIMISTIC);

for (int g = 0; g < 1000; g++)
{
    ODocument doc = new ODocument(db, &quot;Address&quot;);
    doc.fromJSON(contents);
    doc.save();
    System.out.println(g);
}

db.commit();

<b>What is the expected output? What do you see instead?</b>
I expected that a thousand documents were inserted in the database in one transaction for better performance than one transaction for each document. Instead I only see one record is inserted in the database. It works without the transaction, but I really need transactions for the project in which I would like to use OrientDB.

<b>Please use labels and text to provide additional information.</b>
INSERT, transaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant