2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = libgda-GdaTransaction.html
27 * outFile = Transaction
28 * strct = GdaTransaction
45 * - GdaDataModel* -> DataModel
46 * - GdaFieldAttributes* -> FieldAttributes
47 * - GdaTransaction* -> Transaction
52 module gda
.Transaction
;
58 import tango
.io
.Stdout
; // use the tango loging?
62 private import gdac
.gdatypes
;
64 private import gdac
.gda
;
74 public class Transaction
77 /** the main Gtk struct */
78 protected GdaTransaction
* gdaTransaction
;
81 public GdaTransaction
* getTransactionStruct()
83 return gdaTransaction
;
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gdaTransaction
;
94 * Sets our main struct and passes it to the parent class
96 public this (GdaTransaction
* gdaTransaction
)
100 if ( gdaTransaction
is null )
105 Stdout("struct gdaTransaction is null on constructor").newline
;
109 printf("struct gdaTransaction is null on constructor");
116 assert(gdaTransaction
!is null, "struct gdaTransaction is null on constructor");
118 this.gdaTransaction
= gdaTransaction
;
126 * Creates a new GdaTransaction object, which allows a fine-tune and
127 * full control of transactions to be used with providers.
129 * name for the transaction.
131 * the newly created object.
133 public this (char[] name
)
135 // GdaTransaction* gda_transaction_new (const gchar *name);
136 this(cast(GdaTransaction
*)gda_transaction_new(Str
.toStringz(name
)) );
141 * Gets the isolation level for the given transaction. This specifies
142 * the locking behavior for the database connection during the given
145 * a GdaTransaction object.
147 * the isolation level.
149 public GdaTransactionIsolation
getIsolationLevel()
151 // GdaTransactionIsolation gda_transaction_get_isolation_level (GdaTransaction *xaction);
152 return gda_transaction_get_isolation_level(gdaTransaction
);
156 * Sets the isolation level for the given transaction.
158 * a GdaTransaction object.
160 * the isolation level.
162 public void setIsolationLevel(GdaTransactionIsolation level
)
164 // void gda_transaction_set_isolation_level (GdaTransaction *xaction, GdaTransactionIsolation level);
165 gda_transaction_set_isolation_level(gdaTransaction
, level
);
169 * Retrieves the name of the given transaction, as specified by the
170 * client application (via a non-NULL parameter in the call to
171 * gda_transaction_new, or by calling gda_transaction_set_name).
172 * Note that some providers may set, when you call
173 * gda_connection_begin_transaction, the name of the transaction if
174 * it's not been specified by the client application, so this function
175 * may return, for some providers, values that you don't expect.
177 * a GdaTransaction object.
179 * the name of the transaction.
181 public char[] getName()
183 // const gchar* gda_transaction_get_name (GdaTransaction *xaction);
184 return Str
.toString(gda_transaction_get_name(gdaTransaction
) );
188 * Sets the name of the given transaction. This is very useful when
189 * using providers that support named transactions.
191 * a GdaTransaction object.
193 * new name for the transaction.
195 public void setName(char[] name
)
197 // void gda_transaction_set_name (GdaTransaction *xaction, const gchar *name);
198 gda_transaction_set_name(gdaTransaction
, Str
.toStringz(name
));