Hi,

This is a very simple question concerning transactions:

I need to make a user-registration in multiple steps:

1. The user enters a pin code that corresponds to a certain amount of money
he/she spent to get access to the application
    -> application checks the pin code, and marks a corresponding pinCode
EJB that the pin code is now used (it cannot be used by another user at the
same time)

2. The user sets his/her pseudo
    -> application creates a new User EJB
    -> application validates pseudo

3. The user sets his/her password
    -> application validates password
    -> application sets the password on the User EJB

4. The user sets preferences and provides additional info
    -> application stores the data on the User EJB

5. The user terminates and is prompted to log in
    -> everything's OK, the transaction can commit

At any point, the user can leave is/her chair/terminal so everything has to
be rolled back after a given amount of time. This also means that the
temporary objects (rows), like the User EJB, have to be deleted.

I'm not sure I've well understood the transaction mechanism. In particular,
I don't understand when the transaction really begins and ends. As far as I
got it, the transaction is a call-level mechanism: if a method is called on
an object and that method calls another method of another object, the whole
call chain forms the transaction. What I really need is a client to make a
call to an object's method, then later, when my client makes a call to
another object's method, to be able, if anything goes wrong, to undo what
was done before when the first object's method was called. I think the
following settings don't allow for such a thing:

<ejb-jar>
    ...
    <assembly-descriptor>
    ...
    <container-transaction>
        <method>
            <ejb-name>User</ejb-name>
            <method-name>*</method-name>
        </method>
        <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
        <method>
            <ejb-name>PinCode</ejb-name>
            <method-name>markUsed</method-name>
        </method>
        <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
</ejb-jar>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to