MWBEGIN

Section: MidWay Programmer's Manual (3C)
Updated: DATE
Index Return to Main Contents
 

NAME

mwbegin, mwcommit, mwabort - MidWay Global transaction control  

SYNOPSIS

#include <MidWay.h>

int mwbegin(float secs, int flags);

int mwcommit();
int mwabort();

 

DESCRIPTION

These calls are intended to start and end a global transaction. All work done will be commit upon a mwcommit() or all rolled back on mwabort(). However if the deadline is reached a mwabort() is implicit, except for a deadline reset is not performed.

However this requires that all stable storage support the XA interface, or something similar. In addition MidWay need a XA compatible transaction manager. This is not yet implemented in MidWay.

Another purpose of these calls are to set a deadline on service calls. If secs is not 0.0, the API will mark all service calls with a deadline, if processing in the server begins after the deadline expires, the server will return the request immediately with ETIME without sending it to the service routine. This is actually a important practice in all high availability application. It is always a possibility that you may experience a burst of requests that exceed the servers ability to process them. Without a deadline the servers will process them all and you may have a situation where the servers processes really old requests. Another reason may be that a service routine hangs for a long time, and a lot of requests that not longer of interest are queued. Since the server will discard requests overdue, the recovery time of a hang or overload is substantially shorter. mwcommit and abort currently only set the deadline back to 0 (no deadline).

This functionality will be supported in the future by setting the MWNOTRAN flag. In order to be forward compatible MWNOTRAN should always be set when you are only in need of a deadline.

 

RETURN VALUES

They all always return 0.

 

ERRORS

 

WARNINGS

Not that if you set the deadline with mwbegin() you must clear it with mwcommit() or mwabort() or all mw(a)calls after the deadline expires will return with timeout (-ETIME) immediately.

 

EXAMPLES

 

BUGS

 

SEE ALSO

 

STANDARDS

X/Open XA


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
ERRORS
WARNINGS
EXAMPLES
BUGS
SEE ALSO
STANDARDS

This document was created by man2html, using the manual pages.
Time: 11:18:49 GMT, October 24, 2000