[seam-dev] Transaction Events

Jason Porter lightguard.jp at gmail.com
Thu Jan 5 01:32:48 EST 2012


These are events you're observing?

On Wed, Jan 4, 2012 at 23:27, Dave Oxley <dave at daveoxley.co.uk> wrote:

> Hi,
>
> I've been attempting to add persistence to the seam-cron module for
> which I need to use transaction events. Unfortunately I cannot get them
> to work. They always get called immediately rather than when the
> transaction is completed. So I turned to the seam-booking example
> (https://github.com/seam/examples/tree/master/booking) which I saw was
> using transaction events and added some logging (attached), but this
> appears to have the same issue. The output from the log is:
>
> 17:13:16,580 INFO
> [org.jboss.seam.examples.booking.booking.BookingAgent]
> (http--127.0.0.1-8080-1) confirm begin
> 17:13:16,587 INFO
> [org.jboss.seam.examples.booking.booking.BookingHistory]
> (http--127.0.0.1-8080-1) Adding new booking to user's cached booking
> history
> 17:13:16,588 INFO
> [org.jboss.seam.examples.booking.booking.BookingAgent]
> (http--127.0.0.1-8080-1) onBookingComplete begin
> 17:13:16,589 INFO
> [org.jboss.seam.examples.booking.booking.BookingAgent]
> (http--127.0.0.1-8080-1) New booking at the W New York - Union Square
> confirmed for Shane Bryzak.
> 17:13:16,599 INFO
> [org.jboss.seam.examples.booking.booking.BookingAgent]
> (http--127.0.0.1-8080-1) onBookingComplete end
> 17:13:16,600 INFO
> [org.jboss.seam.examples.booking.booking.BookingAgent]
> (http--127.0.0.1-8080-1) confirm end
>
> But in theory the order of the logging should be:
> confirm begin
> confirm end
> onBookingComplete begin
> onBookingComplete end
>
> I did note that there was nothing specifying a transaction was required
> for the entirety of the confirm method so I also added
> @TransactionAttribute(TransactionAttributeType.REQUIRED) to the method
> (also in attached patch), but that had the same result.
>
> I've been trying this in jboss-as-web-7.0.2.Final. I'm probably doing
> something wrong but I don't know what. Does anyone have any ideas?
>
> Cheers,
> Dave.
>
> _______________________________________________
> seam-dev mailing list
> seam-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/seam-dev
>
>


-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate
Author of Seam Catch - Next Generation Java Exception Handling

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/seam-dev/attachments/20120104/67e65a0e/attachment.html 


More information about the seam-dev mailing list