File tree Expand file tree Collapse file tree 3 files changed +22
-16
lines changed
repository/Grease-GemStone-Core.package Expand file tree Collapse file tree 3 files changed +22
-16
lines changed Original file line number Diff line number Diff line change 11* grease- gemstone- core
22doTransaction: aBlock
3- " Evaluate aBlock in a transaction.
3+ " Evaluate aBlock in a transaction.
44 Return true if the transaction succeeds and false if the transaction fails.
55 Nested calls are allowed and will always return true.
66 See System class>>transactionConflicts for dealing with failed transactions."
77
8- " Ensure that each block evaluation is mutually exclusive: https://code.google.com/p/glassdb/issues/detail?id=355"
9- self transactionMutex critical: [
10- " Get the transactionMutex, and perform the transaction."
11- System inTransaction
12- ifTrue: [ " We already are in a transaction, so just evaluate the block"
13- aBlock value.
14- ^ true ]
15- ifFalse: [
16- [
17- self doBeginTransaction.
18- aBlock value
19- ] ensure : [ ^ self doCommitTransaction]]]
20-
8+ " Ensure that each block evaluation is mutually exclusive: https://code.google.com/p/glassdb/issues/detail?id=355"
9+
10+ self transactionMutex
11+ critical: [
12+ | commitResult |
13+ " Get the transactionMutex, and perform the transaction."
14+ System inTransaction
15+ ifTrue: [
16+ " We already are in a transaction, so just evaluate the block"
17+ aBlock value.
18+ ^ true ]
19+ ifFalse: [
20+ [
21+ self doBeginTransaction.
22+ aBlock value ]
23+ ensure : [
24+ " workaround for Bug 42963: ensure: block executed twice (don't return from ensure: block)"
25+ commitResult := self doCommitTransaction ] ].
26+ ^ commitResult ]
Original file line number Diff line number Diff line change 1616 "doAbortTransaction" : " dkh 11/06/2009 08:41" ,
1717 "doBeginTransaction" : " dkh 11/06/2009 08:41" ,
1818 "doCommitTransaction" : " dkh 11/06/2009 08:41" ,
19- "doTransaction:" : " JohanBrichau 03 /21/2014 17:45 " ,
19+ "doTransaction:" : " dkh 12 /21/2014 16:11 " ,
2020 "ensureExistenceOfFolder:" : " DaleHenrichs 12/03/2010 16:28" ,
2121 "filesIn:" : " DaleHenrichs 09/02/2010 15:45" ,
2222 "isProcessTerminated:" : " dkh 11/06/2009 08:41" ,
You can’t perform that action at this time.
0 commit comments