package Ġio . github . nov em dec illion . adapter . api Ċ Ċ import Ġgraphql . Exception While Data Fetching Ċ import Ġgraphql . Execution Result Ċ import Ġgraphql . execution . instrumentation . Instrumentation Context Ċ import Ġgraphql . execution . instrumentation . Simple Instrumentation Ċ import Ġgraphql . execution . instrumentation . Simple Instrumentation Context Ċ import Ġgraphql . execution . instrumentation . parameters . Instrumentation Execute Operation Parameters Ċ import Ġgraphql . language . Operation Definition Ċ import Ġio . github . nov em dec illion . utils . lang . logger Ċ import Ġorg . springframework . stereotype . Component Ċ import Ġorg . springframework . transaction . Platform Transaction Manager Ċ import Ġorg . springframework . transaction . support . Transaction Template Ċ Ċ @ Component Ċ class ĠPer Request Transaction Instrumentation ( private Ġval Ġtransaction Manager : ĠPlatform Transaction Manager ) Ġ: ĊĠ ĠSimple Instrumentation () Ġ{ ĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġval Ġlog Ġ= Ġlogger () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġbegin Execute Operation ( parameters : ĠInstrument ation Execute Operation Parameters ): ĠInstrument ation Context < Execution Result > Ġ{ ĊĠĠĠ Ġlog . debug (" transaction Ġstart ") ĊĠĠĠ Ġval Ġtx Ġ= ĠTransaction Template ( transaction Manager ) ĊĠĠĠ Ġif Ġ( Operation Definition . Operation . QUERY Ġ== Ġparameters . executionContext . operation Definition . operation ) Ġ{ ĊĠĠĠĠĠ Ġtx . is ReadOnly Ġ= Ġtrue ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġstatus Ġ= Ġtransaction Manager . getTransaction ( tx ) ĊĠĠĠ Ġreturn ĠSimple Instrumentation Context . when Completed Ġ{ Ġresult , Ġe Ġ-> ĊĠĠĠĠĠ Ġlog . debug (" transaction Ġend ") ĊĊĠĠĠĠĠ Ġwhen Ġ{ ĊĠĠĠĠĠĠĠ Ġ( e Ġ!= Ġnull ) ĊĠĠĠĠĠĠĠĠĠ Ġ|| Ġ( result . errors . isNotEmpty ()) ĊĠĠĠĠĠĠĠ Ġ-> Ġtransaction Manager . rollback ( status ) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġtransaction Manager . commit ( status ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ }