Skip to content

Migration guide v3.0.0

Geoffroy Jamgotchian edited this page May 28, 2019 · 25 revisions

Nodes consistency

The creation of a business object like a case involves several low level operations in the storage layer like: create node, add data, add dependency ...

We can have a consistency issue if another process query a node when its data update is in progress.

In this revision we've added a new concept called node consistency. From now, nodes are created inconsistent by default. User should call the appStorage method setConsistent(String nodeId) to mark a node as consistent. That allows us to activate 'business objects' when all updates on the node are done.

As a result of this evolution, the sequence of operations for business objects creation is: create node, (add/update) data then mark node as consistent.

Impact : before this version, the getChildNodes(String nodeId) method in AppStorage returns all child nodes, now that method returns only consistent nodes, if the parentNode is inconsistent a AfsStorageException will be thrown. Same logic for getTimeSeriesNames(String nodeId), getTimeSeriesDataVersions(String nodeId) ...

Exemple taken from ImportedCaseBuilder, At the end of the following operations setConsistent(String nodeId) should be called to mark the node as consistent (ready for use).

...
 // create project file
NodeInfo info = context.getStorage().createNode(context.getFolderInfo().getId(), name, ImportedCase.PSEUDO_CLASS, "", ImportedCase.VERSION, new NodeGenericMetadata()
// store case data
importer.copy(dataSource, new AppStorageDataSource(context.getStorage(), info.getId(), info.getName()));
// mark the node as consistent
context.getStorage().setConsistent(info.getId());
...

NB : some new commands have been added for migration purpose, see here

IIDM network creation

Previously an empty IIDM network could be created using NetworkFactory static method:

Network network = NetworkFactory.create("test", "code");

This method has been deprecated and has to be replaced by following code:

Network network = Network.create("test", "code");

WARNING: Network.create now always use default in memory implementation of IIDM even if another IIDM implementation in present in the classpath (through NetworkFactoryService).

Clone this wiki locally