Previous: Actor pattern
framework |
Up: Usage |
Next: Security
considerations |
SemiSpace supports storage of elements in a relation database. The strategy is to perform a poll based persistence on elements having a lifetime larger than a threshold.
To put this another way: It is not useful to persist objects that have a lifetime less than the time it takes the server to re-start. Therefore, no action is necessary for objects that are present only for data exchange. Cache elements and other elements with a long life, on the other hand, can benefit from being stored - which makes them resilient to shutdowns and such.
The persistence plugin does this with a Hibernate configured back end.
Beware of delays: If a long term object is inserted into the space, and the space is terminated with a kill immediately after, the object is lost, as it has not yet been picked up as eligible for storage. This means that your implementation must make allowances for loosing long term objects.
Reinsertions during restart allows you to insert duplicates, or not. Both strategies can give you mismatches. If you insert duplicates, all objects are reintroduced to the space, and a repetitive restart will give the space too many elements of a wrong type. If you do not insert duplicates, a query is performed to see if the object is already present. If it is, it is not re-introduced. This means that if you have more than one object with identical properties, one or more copies are lost.
Previous: Actor pattern
framework |
Up: Usage |
Next: Security
considerations |