Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Transactions

To commit multiple statements, group them using transactions.

By default, all database statements are individually committed. For example, if an insert call results in multiple insert statements, then each one gets committed individually. You can, however, use transactions. To group statements inside a transaction, call the `beginTransaction()` function before the statements, and call `commit()` after all the statements. Use `rollback()` to roll back the entire transaction in the event of an exception.

## Example

    try
    {
      Database.setCurrentConnection ("/MyDbConnection");
      Database.beginTransaction ();
      Concept instance=Instance.createInstance("/someconcept");
      Database.insert(instance)
      Database.commit();
    }
    catch (Exception e)
    {
      Database.rollback();
    }
    finally
    {
    Database.unsetConnection();
    }

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.