db4o 7.4

com.db4o.config
Interface ClientServerConfiguration


public interface ClientServerConfiguration

Client/Server configuration interface.


Method Summary
 void batchMessages(boolean flag)
          Configures to batch messages between client and server.
 MessageSender getMessageSender()
          returns the MessageSender for this Configuration context.
 void maxBatchQueueSize(int maxSize)
          Configures the maximum memory buffer size for batched message.
 void prefetchIDCount(int prefetchIDCount)
          Sets the number of IDs to be pre-allocated in the database for new objects created on the client.
 void prefetchObjectCount(int prefetchObjectCount)
          Sets the number of objects to be prefetched for an ObjectSet in C/S mode.
 void setMessageRecipient(MessageRecipient messageRecipient)
          sets the MessageRecipient to receive Client Server messages.
 void singleThreadedClient(boolean flag)
          configures the client messaging system to be single threaded or multithreaded.
 void timeoutClientSocket(int milliseconds)
          configures the time a client waits for a message response from the server.
 void timeoutServerSocket(int milliseconds)
          configures the timeout of the serverside socket.
 

Method Detail

prefetchIDCount

void prefetchIDCount(int prefetchIDCount)
Sets the number of IDs to be pre-allocated in the database for new objects created on the client. This setting should be used on the client side. In embedded mode this setting has no effect.

Parameters:
prefetchIDCount - The number of IDs to be prefetched

prefetchObjectCount

void prefetchObjectCount(int prefetchObjectCount)
Sets the number of objects to be prefetched for an ObjectSet in C/S mode. This setting should be used on the server side. In embedded mode this setting has no effect.

Parameters:
prefetchObjectCount - The number of objects to be prefetched

setMessageRecipient

void setMessageRecipient(MessageRecipient messageRecipient)
sets the MessageRecipient to receive Client Server messages.

This setting should be used on the server side.

Parameters:
messageRecipient - the MessageRecipient to be used

getMessageSender

MessageSender getMessageSender()
returns the MessageSender for this Configuration context. This setting should be used on the client side.

Returns:
MessageSender

timeoutClientSocket

void timeoutClientSocket(int milliseconds)
configures the time a client waits for a message response from the server.

Default value: 600000ms (10 minutes)

It is recommended to use the same values for timeoutClientSocket(int) and timeoutServerSocket(int).
This setting can be used on both client and server.

Parameters:
milliseconds - time in milliseconds

timeoutServerSocket

void timeoutServerSocket(int milliseconds)
configures the timeout of the serverside socket.

The serverside handler waits for messages to arrive from the client. If no more messages arrive for the duration configured in this setting, the client will be disconnected.
Clients send PING messages to the server at an interval of Math.min(timeoutClientSocket(), timeoutServerSocket()) / 2 and the server will respond to keep connections alive.
Decrease this setting if you want clients to disconnect faster.
Increase this setting if you have a large number of clients and long running queries and you are getting disconnected clients that you would like to wait even longer for a response from the server.
Default value: 600000ms (10 minutes)

It is recommended to use the same values for timeoutClientSocket(int) and timeoutServerSocket(int).
This setting can be used on both client and server.

Parameters:
milliseconds - time in milliseconds

singleThreadedClient

void singleThreadedClient(boolean flag)
configures the client messaging system to be single threaded or multithreaded.

Recommended settings:
- true for low resource systems.
- false for best asynchronous performance and fast GUI response.

Default value:
- .NET Compactframework: true
- all other platforms: false

This setting can be used on both client and server.

Parameters:
flag - the desired setting

batchMessages

void batchMessages(boolean flag)
Configures to batch messages between client and server. By default, batch mode is enabled.

This setting can be used on both client and server.

Parameters:
flag - false, to turn message batching off.

maxBatchQueueSize

void maxBatchQueueSize(int maxSize)
Configures the maximum memory buffer size for batched message. If the size of batched messages is greater than maxSize, batched messages will be sent to server.

This setting can be used on both client and server.

Parameters:
maxSize -

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.