From 92713ee4b8ac61bdc6aef12ddc9838626e486286 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 5 Dec 2008 22:03:04 +0000 Subject: [PATCH] Let's do our adding in a single event. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5580 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/crowd/server/PlaceManager.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/java/com/threerings/crowd/server/PlaceManager.java b/src/java/com/threerings/crowd/server/PlaceManager.java index 611fc153c..03e305b22 100644 --- a/src/java/com/threerings/crowd/server/PlaceManager.java +++ b/src/java/com/threerings/crowd/server/PlaceManager.java @@ -316,17 +316,21 @@ public class PlaceManager */ public void bodyWillEnter (BodyObject body) { - // create a new occupant info instance + // create a new occupant info instance and insert it into our canonical table OccupantInfo info = body.createOccupantInfo(_plobj); - - // insert the occupant info into our canonical table _occInfo.put(info.getBodyOid(), info); - // clone the canonical copy and insert it into the DSet - _plobj.addToOccupantInfo((OccupantInfo)info.clone()); + _plobj.startTransaction(); + try { + // clone the canonical copy and insert it into the DSet + _plobj.addToOccupantInfo((OccupantInfo)info.clone()); - // add the body oid to our place object's occupant list - _plobj.addToOccupants(body.getOid()); + // add the body oid to our place object's occupant list + _plobj.addToOccupants(body.getOid()); + + } finally { + _plobj.commitTransaction(); + } } /**