2001-05-23 15:26:42 +02:00
|
|
|
/*
|
|
|
|
* PROGRAM: JRD Access Method
|
|
|
|
* MODULE: vio_proto.h
|
2003-12-31 06:36:12 +01:00
|
|
|
* DESCRIPTION: Prototype header file for vio.cpp
|
2001-05-23 15:26:42 +02:00
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Interbase Public
|
|
|
|
* License Version 1.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy
|
|
|
|
* of the License at http://www.Inprise.com/IPL.html
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an
|
|
|
|
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
|
|
|
|
* or implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Inprise Corporation
|
|
|
|
* and its predecessors. Portions created by Inprise Corporation are
|
|
|
|
* Copyright (C) Inprise Corporation.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
2002-10-29 21:20:44 +01:00
|
|
|
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
|
|
|
|
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
|
2001-05-23 15:26:42 +02:00
|
|
|
*/
|
|
|
|
|
2003-10-03 03:53:34 +02:00
|
|
|
#ifndef JRD_VIO_PROTO_H
|
|
|
|
#define JRD_VIO_PROTO_H
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-03-20 15:57:40 +01:00
|
|
|
namespace Jrd {
|
|
|
|
class jrd_rel;
|
|
|
|
class jrd_tra;
|
|
|
|
class Record;
|
2004-03-28 11:10:30 +02:00
|
|
|
class RecordSource;
|
2004-03-20 15:57:40 +01:00
|
|
|
struct record_param;
|
|
|
|
class Savepoint;
|
2004-03-30 06:10:52 +02:00
|
|
|
class Format;
|
2012-08-02 10:55:21 +02:00
|
|
|
class TraceSweepEvent;
|
2004-03-20 15:57:40 +01:00
|
|
|
}
|
2004-03-11 06:04:26 +01:00
|
|
|
|
2004-03-20 15:57:40 +01:00
|
|
|
void VIO_backout(Jrd::thread_db*, Jrd::record_param*, const Jrd::jrd_tra*);
|
2009-04-26 12:24:44 +02:00
|
|
|
bool VIO_chase_record_version(Jrd::thread_db*, Jrd::record_param*,
|
2008-01-29 11:11:52 +01:00
|
|
|
Jrd::jrd_tra*, MemoryPool*, bool);
|
2011-03-05 18:33:01 +01:00
|
|
|
void VIO_copy_record(Jrd::thread_db*, Jrd::record_param*, Jrd::record_param*);
|
2008-01-29 11:11:52 +01:00
|
|
|
void VIO_data(Jrd::thread_db*, Jrd::record_param*, MemoryPool*);
|
2004-03-20 15:57:40 +01:00
|
|
|
void VIO_erase(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*);
|
|
|
|
void VIO_fini(Jrd::thread_db*);
|
|
|
|
bool VIO_garbage_collect(Jrd::thread_db*, Jrd::record_param*, const Jrd::jrd_tra*);
|
|
|
|
Jrd::Record* VIO_gc_record(Jrd::thread_db*, Jrd::jrd_rel*);
|
2009-04-26 12:24:44 +02:00
|
|
|
bool VIO_get(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*, MemoryPool*);
|
2009-12-13 14:49:43 +01:00
|
|
|
bool VIO_get_current(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*,
|
2009-04-26 12:24:44 +02:00
|
|
|
MemoryPool*, bool, bool&);
|
2004-03-20 15:57:40 +01:00
|
|
|
void VIO_init(Jrd::thread_db*);
|
|
|
|
void VIO_merge_proc_sav_points(Jrd::thread_db*, Jrd::jrd_tra*, Jrd::Savepoint**);
|
2009-12-09 19:45:44 +01:00
|
|
|
bool VIO_writelock(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*);
|
2004-03-20 15:57:40 +01:00
|
|
|
void VIO_modify(Jrd::thread_db*, Jrd::record_param*, Jrd::record_param*, Jrd::jrd_tra*);
|
2009-12-09 19:45:44 +01:00
|
|
|
bool VIO_next_record(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*, MemoryPool*, bool);
|
2008-01-29 11:11:52 +01:00
|
|
|
Jrd::Record* VIO_record(Jrd::thread_db*, Jrd::record_param*, const Jrd::Format*, MemoryPool*);
|
2005-03-27 17:01:56 +02:00
|
|
|
void VIO_refetch_record(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*);
|
2004-03-20 15:57:40 +01:00
|
|
|
void VIO_start_save_point(Jrd::thread_db*, Jrd::jrd_tra*);
|
|
|
|
void VIO_store(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*);
|
2012-08-02 10:55:21 +02:00
|
|
|
bool VIO_sweep(Jrd::thread_db*, Jrd::jrd_tra*, Jrd::TraceSweepEvent*);
|
2004-03-20 15:57:40 +01:00
|
|
|
void VIO_verb_cleanup(Jrd::thread_db*, Jrd::jrd_tra*);
|
2004-09-28 23:50:10 +02:00
|
|
|
IPTR VIO_savepoint_large(const Jrd::Savepoint*, IPTR);
|
2012-01-24 04:37:43 +01:00
|
|
|
void VIO_temp_cleanup(Jrd::jrd_tra*);
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2009-10-21 02:42:38 +02:00
|
|
|
namespace Jrd
|
|
|
|
{
|
|
|
|
// Starts a savepoint and rollback it in destructor if release() is not called.
|
|
|
|
class AutoSavePoint
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AutoSavePoint(thread_db* tdbb, jrd_tra* aTransaction);
|
|
|
|
~AutoSavePoint();
|
|
|
|
|
|
|
|
void release()
|
|
|
|
{
|
|
|
|
released = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
jrd_tra* transaction;
|
|
|
|
bool released;
|
|
|
|
};
|
2012-09-24 16:26:33 +02:00
|
|
|
|
|
|
|
class StableCursorSavePoint
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StableCursorSavePoint(thread_db* tdbb, jrd_tra* transaction, bool start);
|
|
|
|
|
|
|
|
~StableCursorSavePoint()
|
|
|
|
{
|
|
|
|
release();
|
|
|
|
}
|
|
|
|
|
|
|
|
void release();
|
|
|
|
|
|
|
|
private:
|
|
|
|
thread_db* m_tdbb;
|
|
|
|
jrd_tra* m_tran;
|
|
|
|
SLONG m_number;
|
|
|
|
};
|
2009-10-21 02:42:38 +02:00
|
|
|
}
|
|
|
|
|
2003-11-06 04:03:36 +01:00
|
|
|
#endif // JRD_VIO_PROTO_H
|