X Tutup
Skip to content

Commit de396c9

Browse files
author
Johan Brichau
committed
unexpected semantics of #doTransaction: with multithreading (used in WAGemStoneServiceTask)
1 parent dae0fc2 commit de396c9

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
transactions
1+
*grease-gemstone-core
22
doTransaction: aBlock
33
"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-
System inTransaction
9-
ifTrue: [ "We alread in a transaction, so just evaluate the block"
10-
aBlock value.
11-
^true].
8+
"Ensure that each block evaluation is mutually exclusive: https://code.google.com/p/glassdb/issues/detail?id=355"
129
self transactionMutex critical: [
1310
"Get the transactionMutex, and perform the transaction."
14-
[
15-
self doBeginTransaction.
16-
aBlock value.
17-
] ensure: [
18-
^self doCommitTransaction]].
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+

repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"doAbortTransaction" : "dkh 11/06/2009 08:41",
1616
"doBeginTransaction" : "dkh 11/06/2009 08:41",
1717
"doCommitTransaction" : "dkh 11/06/2009 08:41",
18-
"doTransaction:" : "dkh 11/06/2009 08:41",
18+
"doTransaction:" : "JohanBrichau 03/21/2014 17:45",
1919
"ensureExistenceOfFolder:" : "DaleHenrichs 12/03/2010 16:28",
2020
"filesIn:" : "DaleHenrichs 09/02/2010 15:45",
2121
"isProcessTerminated:" : "dkh 11/06/2009 08:41",

0 commit comments

Comments
 (0)
X Tutup