Integer function ( String arg0 , Date arg1 ) { System . out . println ( "srini_string" + arg0 + "srini_string" + arg1 + "srini_string" ) ; Taxi2Booking loc0 = new Taxi2Booking ( ) ; loc0 . setName ( arg0 ) ; loc0 . setDate ( arg1 ) ; em . persist ( loc0 ) ; bookingData . setBookingId ( loc0 . getId ( ) ) ; return loc0 . getId ( ) ; }
places a booking . as this is a simple example , all the method does is mark the booking as pending in the database . the @txcompensate annotation specifies which compensation handler to invoke if the transaction is cancelled . in this example the compensation handler will update the booking from state ` pending ' to ` cancelled ' . the @txconfirm annotation specifies which confirmation handler to invoke if the transaction is closed completed successfully . in this example the confirmation handler will update the booking from state ` pending ' to ` confirmed ' . this method is invoked within a new jta transaction that is automatically committed if the method returns successfully . concode_field_sep EntityManager em concode_elem_sep BookingData bookingData concode_field_sep BookingStatus getBookingStatus