Sessions: Working with sessions

Description Usage Arguments Value Examples

Description

Working with sessions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
startSession(catalog, repo, autocommit = FALSE, lifetime = 100,
  loadInitFile = FALSE, script = NULL)

isActive(Session)

commit(Session)

rollback(Session)

closeSession(Session)

getDescriptionSession(Session)

ping(Session)

Arguments

catalog

Object of type catalog specifying server details and catalog to work in

repo

String that specifies what repository to start session on

autocommit

Defaults to FALSE. Specify whether or not the session should use transactions.

lifetime

The number of seconds the session can be idle before being shutdown and reclaimed.

loadInitFile

If true, then the initfile will be loaded when the session starts.

script

The name of a script file to load; may be specified multiple times.

Session

Session object created by the startSession function

Value

A new repository object that points to the newly created session, belonging to current user. This session object can be substituted for any function in which you were using the repository object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Not run: 

#Starting a session
service = service("localhost","user","password")
rep = repository(catalog(service,"root"),"test")
session = startSession(rep,lifetime = 1000,script = "path/to/script")

## End(Not run)

## Not run: 

#Committing transactions to the repository
service = service("localhost","user","password")
rep = repository(catalog(service,"root"),"test")
session = startSession(rep,lifetime = 1000)
commit(session)

## End(Not run)

## Not run: 

#Other useful functions
service = service("localhost","user","password")
rep = repository(catalog(service,"root"),"test")
session = startSession(rep,lifetime = 100)
getDescriptionSession(session)
isActive(session)
ping(session)
closeSession(session)

## End(Not run)

baasman/allegRo documentation built on May 11, 2019, 5:22 p.m.