Hi everybody,

        I've finally found my problem. I was getting a new instance of Database
with each bean call, thus instanciating a new TransactionContext ojbect
(DUH!!!). I've fixed my problem and everything works now...

        Thank you to all those who answered me...


Sebastien Dumais wrote:
> 
> Hi all,
> 
>         I'm currently trying to implement an ecommerce site using castor for
> DBMS independence. The
> problem I have is that after the checkout, I have to write to the DBMS
> the order data. But some
> related fields are not taken into account while creating even if they
> were loaded/created in the
> current transaction (but not in the same bean, all beans have "REQUIRED"
> transaction attribute though
> so the first bean method invoked starts the transaction and the
> transaction doesn't commit/rollback
> as long as the first bean method invoked doesn't return).
> 
>         In the ClassMolder class, the create method (the one that starts at
> line 802), test
> each field to see if they were created in this transaction, but, for
> some reason, it seems
> as if my objects are not persistent (not created during this
> transaction).
> 
>         While debugging, what I noticed, is that *while* I'm loading an object
> (db.load) the
> object list get wiped out (the _objects property of TransactionContext)
> so when it is time
> to create the order object, the customer object (and other with it) are
> not longer in the transaction.
> 
>         My first thought is maybe a timeout problem, but the timeout is
> supposed to be 30 seconds and
> the processorderbean.order() method certainly doesn't take 30 seconds to
> execute. I even tried an
> update (db.update) on the related objects, but I got an exception saying
> that the lock was already
> acquired in this transaction ( ?:-|  ). I also tried to reload (db.load)
> my related objects in
> a single bean call.... same problem. I don't know anymore.... :-(
> 
>         What's more, when I try the same thing outside JBoss (a plain vanilla
> testOrder.main() ),
> everything works fine....
> 
>         Thank you for your time in helping me
> 
> SD
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to