Documentation Archive Developer
Search
[an error occurred while processing this directive] PATH  Documentation > WebObjects 4.5 > SybaseEOAdaptor Reference

Table of Contents

SybaseContext


Inherits from: EOAdaptorContext : NSObject
Package: com.apple.yellow.sybaseeoadaptor


Class Description


A SybaseContext represents a single transaction scope on the database server to which its adaptor object is connected. Since a Sybase server supports multiple concurrent transaction sessions, the adaptor may have several adaptor contexts. A SybaseContext may in turn have a SybaseChannel, which handles actual access to the data on the server.

The SybaseContext can have a delegate, which gives you access to all messages returned from the Sybase client library or from the Sybase Server. See the SybaseContext.Delegate interface specification for a complete description.




Method Types


Setting the login time out interval
loginTimeOutInterval
setLoginTimeOutInterval
Setting the time out interval
setTimeOutInterval
timeOutInterval
Managing the connection
connect
currentChannel
disconnect
isConnected
setMaximumConnections
maximumConnections
Setting the max text size default
maxTextSizeDefault
setMaxTextSizeDefault
Setting the current exception
raiseCurrentException
setCurrentException


Static Methods



maximumConnections

public static int maximumConnections()

Returns the value for CS_MAX_CONNECT, the maximum number of database connections a Sybase client process can have open simultaneously.

loginTimeOutInterval

public static int loginTimeOutInterval()

Returns the login time out interval used by SybaseContext.

See Also: setLoginTimeOutInterval



setLoginTimeOutInterval

public static void setLoginTimeOutInterval(int seconds)

Sets the login time out interval value SybaseContext uses during the creation of new channels. The default is 0, which means that there is no time out.

See Also: loginTimeOutInterval



setMaximumConnections

public static boolean setMaximumConnections(int value)

Sets CS_MAX_CONNECT, the maximum number of database connections a Sybase client process can have open simultaneously. Returns true if the operation is successful. By default the adaptor uses the Sybase client library default, which is normally sufficient. However, if your application communicates with many databases or uses database authentication for each user, you might need to raise the limit. It is possible to raise the limit after database connections have been opened.

setTimeOutInterval

public static void setTimeOutInterval(int seconds)

Sets the time out interval value that the SybaseContext uses during the creation of new channels. The default is 0, which means that there is no time out.

See Also: timeOutInterval



timeOutInterval

public static int timeOutInterval()

Returns the time out interval used by SybaseContext.


Instance Methods



connect

public void connect()

Opens a connection to the database server. SybaseChannel sends this message to SybaseContext when it (SybaseChannel) is about to open a channel to the server.

See Also: disconnect



currentChannel

public SybaseChannel currentChannel()

Returns the SybaseChannel currently associated with the receiving context.

disconnect

public void disconnect()

Closes a connection to the database server. SybaseChannel sends this message to SybaseContext when it (SybaseChannel) has just closed a channel to the server.

See Also: connect



isConnected

public boolean isConnected()

Returns true if the receiver has an open connection to the database, false otherwise.

See Also: connect, disconnect



maxTextSizeDefault

public int maxTextSizeDefault()

Returns the maximum number of bytes to be returned from a Sybase image to text field. The default is set to INT_MAX, as defined for the host machine. This number can be overwritten on a per-channel basis by sending the appropriate SQL to the channel using the evaluateExpression: method.

raiseCurrentException

public void raiseCurrentException()

If the receiver has an exception, raises it.

See Also: setCurrentException



setCurrentException

public void setCurrentException(Throwable exception)

Sets the receiver's current exception to exception.

When the SybaseAdaptor encounters an error, it uses the error message to build an NSException and stores the exception in the SybaseContext using this method. The exception can then be reviewed by other components to determine if the error is fatal.

See Also: raiseCurrentException



setMaxTextSizeDefault

public void setMaxTextSizeDefault(int textSize)

Sets the receiver's default text size to textSize. Any channels created after this method has been invoked will use the newly specified text size.


Table of Contents