▁@ Request Sc oped ▁public ▁class ▁Example Bean ▁{ ▁▁▁▁▁ ▁@ Transaction al ▁▁▁▁ ▁public ▁void ▁foo () ▁{ ▁// ▁A ▁transaction ▁is ▁active ▁here ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▁ ▁// ▁Do ▁work ▁▁▁▁▁ ▁} ▁// ▁After ▁the ▁method ▁returns ▁transaction ▁is ▁committed ▁or ▁rolled ▁back ▁} ▁ ▁Trans action al ▁behavior ▁can ▁be ▁configured ▁via ▁an ▁attribute ▁on ▁the ▁annotation . ▁The ▁available ▁options ▁closely ▁mirror ▁those ▁of ▁the ▁E JB ▁specification . ▁ ▁@ Transaction Sc oped ▁annotation ▁The ▁ ▁annotation ▁provides ▁the ▁application ▁the ▁ability ▁to ▁declare ▁that ▁the ▁scope ▁during ▁which ▁a ▁bean ▁lives ▁is ▁tied ▁to ▁the ▁time ▁a ▁given ▁transaction ▁is ▁active . ▁ ▁The ▁code ▁sample ▁below ▁illustr ates ▁the ▁usage ▁of ▁@ Transaction Sc oped ▁in ▁a ▁request ▁scop ed ▁C DI ▁managed ▁bean : ▁ ▁@ Transaction Sc oped ▁public ▁class ▁T x Sc oped Bean ▁{ ▁▁▁▁ ▁public ▁int ▁number ; ▁▁▁▁▁ ▁public ▁int ▁get Number () ▁{ return ▁number ;} ▁▁▁▁ ▁public ▁void ▁set Number ( int ▁number ) ▁{ this . number ▁= ▁number ;} ▁} ▁ ▁@ Request Sc oped ▁public ▁class ▁Example Bean ▁{ ▁▁▁▁▁ ▁@ Inject ▁▁▁▁ ▁private ▁T x Sc oped Bean ▁tx Sc oped Bean ; ▁▁▁▁▁ ▁@ Transaction al ▁▁▁▁ ▁public ▁void ▁foo () ▁{ ▁▁▁▁▁▁▁▁ ▁tx Sc oped Bean . set Number ( 1 ); ▁▁▁▁ ▁} ▁▁▁▁▁ ▁@ Transaction al ▁▁▁▁ ▁public ▁void ▁bar () ▁{ ▁▁▁▁▁▁▁▁ ▁System . out . print ( t X scop ed Bean . get Number ()); ▁▁▁▁ ▁} ▁} ▁