Question
· Jan 13

Intersystems Data Models and ACID

Hello! 
So my question is quite simple, Do the different data models of Intersystems all support the ACID properties?
I assume that for the SQL data model implementation it does, But does it also work for global (i.e the hierarchical  data model)?

I searched the docs and the different articles, It seems for example that here its implied that the different data models of
Intersystems  DO indeed support the ACID properties and allow for safe insertion, deletion etc... in concurrent operations to the server that is.

 

Would love to get a clarification, Thx!

Product version: Caché 2018.1
Discussion (7)2
Log in or sign up to continue

does it also work for global (i.e the hierarchical  data model)?

Simple answer: yes, it sure does.

Your code implementation need to use transactions (TSTART, TCOMMIT, TROLLBACK) commands to implement ACID.

Don't forget that, in the end, using Objects and/or SQL, the code executed use globals.

Using Objects and/or SQL the framework implement transaction for you, using globals you need to implement/code it.

Hello @omer 

The above same is ACID complaint when using transactions. It will be reverted  to old value under transaction rollback. However, The counter values are incremented by  $Increment and $Sequence are will not changed even rollback.

LEARNING>w ^myTracker("onSomething")
1
LEARNING>ts
 
TL1:LEARNING>s ^myTracker("onSomething")=12
 
TL1:LEARNING>w ^myTracker("onSomething")
12
TL1:LEARNING>trollback
 
LEARNING>w ^myTracker("onSomething")
1
LEARNING>

$Increment and $sequence

LEARNING>write ^myTracker("onSomething")
1
LEARNING>tstart
 
TL1:LEARNING>do $Increment(^myTracker("onSomething"))
 
TL1:LEARNING>write ^myTracker("onSomething")
2
TL1:LEARNING>trollback
 
LEARNING>write ^myTracker("onSomething")
2
LEARNING>

Hi @Ashok Kumar , you also need to use lock to properly implement ACID, something like:

LEARNING>lock +^myTracker("onSomething")
LEARNING>w ^myTracker("onSomething")
1
LEARNING>ts
 
TL1:LEARNING>s ^myTracker("onSomething")=12
TL1:LEARNING>w ^myTracker("onSomething")
12
TL1:LEARNING>trollback
LEARNING>w ^myTracker("onSomething")
1
LEARNING>lock -^myTracker("onSomething")
LEARNING>