1 Reply Latest reply on Oct 3, 2010 11:16 PM by Yasser Hawari

    Starting a transaction in a Conversation

    Christian Decker Newbie

      I'm pretty new to transactions in seam, so please forgive me if this is trivial.

      I have a screen to edit a 2-dimensional table, each column is an attribute and each row represents an object. We can dynamically add and remove columns and rows, for this to work we have a rather complex table structure, but it works in the end.

      The problem arises when I want to add columns and rows (read: create new objects in the database) but then cancel the editing screen. Since the objects that represent the new fields, columns and rows are created on the server, they are automatically saved to the database, and not deleted at a cancel, which gives really strange results.

      Now I figured we could just wrap the entire editing in a database transaction which is rolled back when the user cancels the form.

      How could I do such a thing?