Changeset 47bb91ab9cc9ef196c89cbc35252197f6588e64c
- Timestamp:
- 04/05/08 13:25:59
(5 months ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1207394759 +0200
- git-parent:
[8e594f76c49f8d638a114db756c0efed7e16acdc]
- git-author:
- Christopher Jung <bktheg@web.de> 1207394759 +0200
- Message:
Transaktionen des Schlachtticks kleiner gefasst
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r9e2d114 |
r47bb91a |
|
| 24 | 24 | import net.driftingsouls.ds2.server.ContextCommon; |
|---|
| 25 | 25 | import net.driftingsouls.ds2.server.battles.Battle; |
|---|
| | 26 | import net.driftingsouls.ds2.server.battles.BattleShip; |
|---|
| 26 | 27 | import net.driftingsouls.ds2.server.framework.Common; |
|---|
| | 28 | import net.driftingsouls.ds2.server.framework.db.HibernateFacade; |
|---|
| | 29 | import net.driftingsouls.ds2.server.ships.Ship; |
|---|
| 27 | 30 | import net.driftingsouls.ds2.server.tick.TickController; |
|---|
| 28 | 31 | |
|---|
| … | … | |
| 83 | 86 | battle.addComMessage(battle.getEnemySide(), "++++ Das Tickscript hat die Runde beendet ++++\n\n"); |
|---|
| 84 | 87 | } |
|---|
| | 88 | getContext().commit(); |
|---|
| 85 | 89 | } |
|---|
| 86 | 90 | catch( RuntimeException e ) { |
|---|
| | 91 | getContext().rollback(); |
|---|
| | 92 | |
|---|
| 87 | 93 | this.log("Battle "+battle.getId()+" failed: "+e); |
|---|
| 88 | 94 | e.printStackTrace(); |
|---|
| 89 | 95 | Common.mailThrowable(e, "BattleTick Exception", "battle: "+battle.getId()); |
|---|
| 90 | | |
|---|
| 91 | | throw e; |
|---|
| 92 | 96 | } |
|---|
| | 97 | |
|---|
| | 98 | db.evict(battle); |
|---|
| | 99 | HibernateFacade.evictAll(db, Ship.class, BattleShip.class); |
|---|
| 93 | 100 | } |
|---|
| 94 | 101 | |
|---|
| 95 | | getDB().flush(); |
|---|
| 96 | 102 | getDB().clear(); |
|---|
| 97 | 103 | } |
|---|