Re: Adding transactions info to mdr events
Martin Matula <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
I have some questions:
Why do you need to know about inner transactions?
Why do you need the transaction be passed into events?
Wouldn't it be enough just to notify you when an outermost transaction
starts and ends, so that you can create checkpoints?
Anyway, file this as a feature request in issuezilla and we can discuss
it there.
Regards,
Martin
Holger Krug wrote:
> Martin, please review this proposal. Please tell me, if you agree. If
> yes I will open an issue.
>
>
>
> It's seems to be common sense that Undo/Redo management should be
> implemented on top of JMI+events. The UndoManager should listen on
> repository change events.
>
> Furthermore undo/redo should respect transaction integrity.
>
> But currently the MDR events do not inform about transactions at
> all. Hence I propose:
>
> 1) Add to interface MDRChangeEvent the method:
>
> MDRTransaction getTransaction();
>
> which returns the innermost transaction performing the change.
>
> The interface MDRTransaction consists solely of the method:
>
> public interface MDRTransaction {
> MDRTransaction getParent();
> }
>
> returning the enclosing transaction or null.
>
>
> 2) Add a new event type:
>
> public class TransactionEvent extends MDRChangeEvent {
> public static int EVENT_TRANSACTION_START = ..;
> public static int EVENT_TRANSACTION_COMMIT = ..;
> public static int EVENT_TRANSACTION_ROLLBACK = ..;
>
> ...
>
> public int getType() {
> ...
> }
> }
>
> Only listeners on the MDRepository are informed about transaction
> events.
>
>
>