10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

How <strong>Programming</strong> for Multiple Sessions WorksThe syntax is:integer = DBSessionObject.Connect(database = varchar(256),[flags = varchar(256)])The DBSessionObject object must not be open already (the state must beDS_DISCONNECTED) when you invoke this method. You can specify anydatabase, including one to which the application already is connected.flagsLets you define the runtime environment for the session. For example, youcan open a session as another user by specifying the -u flag.OpenNew Connection MethodIf the Connect method succeeds in opening the connection, it returns ER_OK.If it does not succeed, it returns an error code.This method opens a connection that is identical to a previously openedconnection. Use this method to have two or more concurrent transactionsagainst the same database with the same parameter settings.The syntax is:DBSessionObject = DBSessionObject.OpenNewConnection()The DBSessionObject object on which the method is invoked must representan open session, because this method uses the existing session as a templatefor the new session.When the method completes, it returns a DBSessionObject object representingthe new session. The new session accesses the same database and runs underthe same flags as the existing session. If the method fails, it returns null.For more information about these statements, see the Language Reference<strong>Guide</strong> online help.192 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!