02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Data Management<br />

transaction that has locked an object, or start a new transaction.<br />

ITransactionManager is defined as:<br />

public interface ITransactionManager<br />

{<br />

object DefaultTransactionContext { get; }<br />

ITransaction NewTransaction (object context);<br />

ITransaction GetCurrent (object context);<br />

ITransaction GetTransaction (object data);<br />

}<br />

event EventHandler TransactionStarted;<br />

event EventHandler TransactionCompleted;<br />

So to find the current transaction in the default context (usually the current thread) you<br />

would use:<br />

//Get the current context<br />

object defaultContext =<br />

DataManager.TransactionManager.DefaultTransactionContext;<br />

//Find the current transaction<br />

ITransaction trans =<br />

DataManager.TransactionManager.GetCurrent(defaultContext);<br />

Workspace Property<br />

The Workspace property represents the in-memory state of the system known as the<br />

workspace. However, in <strong>Ocean</strong> Petrel it represents a sub-store attached to the current<br />

primary project. The user may add objects to the workspace to track their state in the<br />

users’ session. It is up to the application to store any workspace state information if it is to<br />

be used in later sessions. An example of this would be storing the type and content of<br />

windows open when the session ends so they can be displayed at the start of the next<br />

session. Only one workspace is active at a time. The Workspace property guarantees the<br />

presence of IDataSource so objects can rely on having a data source available for<br />

object persistence.<br />

3-64 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!