Changeset 76806620b8f1505e18f2bc31bf07ba480918c120
- Timestamp:
- 07/11/07 22:48:11
(1 year ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1184186891 +0200
- git-parent:
[a4483e5499958869d468ed21b20bc128ba9737a4]
- git-author:
- Christopher Jung <bktheg@web.de> 1184186891 +0200
- Message:
Aenderungen am Transaktionsverhalten
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r69deede |
r7680662 |
|
| 43 | 43 | private String status = null; |
|---|
| 44 | 44 | |
|---|
| | 45 | private static BasicContext basicContext; |
|---|
| | 46 | |
|---|
| 45 | 47 | /** |
|---|
| 46 | 48 | * Bootet DS |
|---|
| … | … | |
| 66 | 68 | |
|---|
| 67 | 69 | SimpleResponse response = new SimpleResponse(); |
|---|
| 68 | | new BasicContext(request, response); |
|---|
| | 70 | basicContext = new BasicContext(request, response); |
|---|
| | 71 | } |
|---|
| | 72 | |
|---|
| | 73 | /** |
|---|
| | 74 | * Gibt alle noch belegten Resourcen frei |
|---|
| | 75 | * |
|---|
| | 76 | */ |
|---|
| | 77 | public static final void free() { |
|---|
| | 78 | basicContext.free(); |
|---|
| 69 | 79 | } |
|---|
| 70 | 80 | |
|---|
| r42c5976 |
r7680662 |
|
| 88 | 88 | tick.execute(); |
|---|
| 89 | 89 | tick.dispose(); |
|---|
| | 90 | free(); |
|---|
| 90 | 91 | } |
|---|
| 91 | 92 | } |
|---|
| r42c5976 |
r7680662 |
|
| 124 | 124 | tick.execute(); |
|---|
| 125 | 125 | tick.dispose(); |
|---|
| | 126 | free(); |
|---|
| 126 | 127 | } |
|---|
| 127 | 128 | } |
|---|
| r1328878 |
r7680662 |
|
| 330 | 330 | |
|---|
| 331 | 331 | this.log(""); |
|---|
| | 332 | |
|---|
| | 333 | if( !getDB().contains(base) ) { |
|---|
| | 334 | getDB().merge(base); |
|---|
| | 335 | } |
|---|
| 332 | 336 | } |
|---|
| 333 | 337 | |
|---|
| … | … | |
| 357 | 361 | for( Iterator iter = bases.iterator(); iter.hasNext(); ) { |
|---|
| 358 | 362 | Base base = (Base)iter.next(); |
|---|
| | 363 | |
|---|
| 359 | 364 | // Muessen ggf noch alte Userdaten geschrieben und neue geladen werden? |
|---|
| 360 | 365 | if( base.getOwner().getID() != this.lastowner ) { |
|---|
| … | … | |
| 367 | 372 | this.usercargo = new Cargo( Cargo.Type.STRING, base.getOwner().getCargo()); |
|---|
| 368 | 373 | } |
|---|
| | 374 | |
|---|
| 369 | 375 | this.lastowner = base.getOwner().getID(); |
|---|
| 370 | | try { |
|---|
| | 376 | try { |
|---|
| 371 | 377 | // Nun wollen wir die Basis mal berechnen.... |
|---|
| 372 | 378 | this.tickBase(base); |
|---|
| 373 | 379 | base.getOwner().setCargo(this.usercargo.save()); |
|---|
| 374 | 380 | |
|---|
| | 381 | getDB().flush(); |
|---|
| 375 | 382 | getContext().commit(); |
|---|
| 376 | 383 | } |
|---|
| … | … | |
| 389 | 396 | base.getOwner().setCargo(this.usercargo.save()); |
|---|
| 390 | 397 | |
|---|
| | 398 | getDB().flush(); |
|---|
| 391 | 399 | getContext().commit(); |
|---|
| 392 | 400 | } |
|---|
| … | … | |
| 430 | 438 | // User-Accs wieder entsperren |
|---|
| 431 | 439 | unblock(0); |
|---|
| | 440 | |
|---|
| | 441 | getDB().setFlushMode(FlushMode.AUTO); |
|---|
| 432 | 442 | } |
|---|
| 433 | 443 | |
|---|
| r7a698da |
r7680662 |
|
| 419 | 419 | |
|---|
| 420 | 420 | auser.setCargo(this.usercargo.save()); |
|---|
| | 421 | getDB().flush(); |
|---|
| 421 | 422 | getContext().commit(); |
|---|
| 422 | 423 | } |
|---|
| … | … | |
| 437 | 438 | |
|---|
| 438 | 439 | auser.setCargo(this.usercargo.save()); |
|---|
| | 440 | getDB().flush(); |
|---|
| 439 | 441 | getContext().commit(); |
|---|
| 440 | 442 | } |
|---|
| … | … | |
| 458 | 460 | } |
|---|
| 459 | 461 | } |
|---|
| | 462 | |
|---|
| | 463 | getDB().setFlushMode(FlushMode.AUTO); |
|---|
| 460 | 464 | |
|---|
| 461 | 465 | db.createQuery("update Ship set crew=0 where id>0 and crew<0").executeUpdate(); |
|---|