| 34 | |
| 35 | {{{ |
| 36 | private static void updateSCG() throws Exception { |
| 37 | |
| 38 | Participant participant = new Participant(); |
| 39 | participant.setLastName(PSRTICIPANT_LAST_NAME); |
| 40 | String query = "some query stuff here"; |
| 41 | List scgList = appService.search( query, participant ); |
| 42 | |
| 43 | Iterator<SpecimenCollectionGroup> scgItr = scgList.iterator(); |
| 44 | SpecimenCollectionGroup sprObj = null; |
| 45 | Site site = BaseTestCaseUtility.initSite(); |
| 46 | site = (Site) appService.createObject(site); |
| 47 | // |
| 48 | // Here is a loop with an update invocation embedded within it. |
| 49 | // Is each update a separate transaction? |
| 50 | // |
| 51 | while (scgItr.hasNext()) { |
| 52 | sprObj = (SpecimenCollectionGroup) scgItr.next(); |
| 53 | sprObj.setCollectionStatus("Complete"); |
| 54 | sprObj.setSpecimenCollectionSite(site); |
| 55 | setEventParameters(sprObj); |
| 56 | // |
| 57 | // Note that this update is within a loop! |
| 58 | // Where is the transaction boundary?... |
| 59 | SpecimenCollectionGroup scg = |
| 60 | (SpecimenCollectionGroup) appService.updateObject( sprObj ) ; |
| 61 | } |
| 62 | |
| 63 | } |
| 64 | }}} |