There are 2 kinds of variables in general
XML DOM based Variables & Entity Variables
DOM based Variables
These are XML variables that adhere to a Schema.
XML Schema defines the structure of the variable.
These are disconnected variables, meaning once the variable value is fetched, it is stored in-memory, and is stored during dehydration. After rehydration / variable being fetched, the same value gets retrieved, irrespective of whether that variable has changed in the database during this course of tim.
All the variables that we’ve been using in all the samples are disconnected variables.
The problem with these kind of variables is that sometimes, these may represent stale data.
For example, lets say varX is retrieved from a database table EMPLOYEES, and after that, assume an asynchronous service has been invoked. This service, say takes an hour to respond back. During this time, the entire state information is saved to the SOA datastore(dehydration). Once the async service responds back, all the state information is retrieved from the datastore
Lets assume that the actual data in the EMPLOYEES table has been changed during this 1 hr. But this change dont reflect in the variable because it has been fetched and stored in varX an hr back
Thus, varX now represent stale data, making varX a disconnected payload
The solution to these kind of scenarios is to have a connected variable, where during dehydration, only the reference is stored but not the actual data
Entity Variable in Oracle SOA Suite 11g is a connected variable, which represents the latest data, always
This is connected in the sense that only the reference to the actual data is stored to the datastore during dehydration, and while rehydration, that reference is evaluated to the actual value, thus making the variable hold the current data always
Hope this gives you an idea on the Entity Variables
Thanks for going through my post, feel free to provide a feedback!