~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/xid.h

  • Committer: Jay Pipes
  • Date: 2009-03-17 05:47:13 UTC
  • mto: This revision was merged to the branch mainline in revision 941.
  • Revision ID: jpipes@serialcoder-20090317054713-4t3t3e9lvzi2epq5
Pulls remainder of XID and xid_cache implementation into xid.cc and xid.h from drizzled/session.cc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
};
81
81
typedef struct st_drizzle_xid DRIZZLE_XID;
82
82
 
 
83
enum xa_states {XA_NOTR=0, XA_ACTIVE, XA_IDLE, XA_PREPARED};
 
84
extern const char *xa_state_names[];
83
85
 
84
86
/* for recover() handlerton call */
85
87
#define MIN_XID_LIST_SIZE  128
86
88
#define MAX_XID_LIST_SIZE  (1024*128)
87
89
 
 
90
typedef struct st_xid_state {
 
91
  /* For now, this is only used to catch duplicated external xids */
 
92
  XID  xid;                           // transaction identifier
 
93
  enum xa_states xa_state;            // used by external XA only
 
94
  bool in_session;
 
95
} XID_STATE;
 
96
 
 
97
bool xid_cache_init(void);
 
98
void xid_cache_free(void);
 
99
XID_STATE *xid_cache_search(XID *xid);
 
100
bool xid_cache_insert(XID *xid, enum xa_states xa_state);
 
101
bool xid_cache_insert(XID_STATE *xid_state);
 
102
void xid_cache_delete(XID_STATE *xid_state);
 
103
 
88
104
#endif /* DRIZZLED_XID_H */