[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/geas lib/classdefs/classdata.c lib/classde...
From: |
Reinhard Mueller |
Subject: |
gnue/geas lib/classdefs/classdata.c lib/classde... |
Date: |
Sat, 01 Sep 2001 07:41:04 -0700 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Branch: geas-0-1-0-branch
Changes by: Reinhard Mueller <address@hidden> 01/09/01 07:41:04
Modified files:
geas/lib/classdefs: classdata.c gcdparser.c
geas/src : collectiondata.c connection.c dataobject.c
objectlist.c query.c transaction.c
geas/src/objectcache: objectcache.c
geas/src/objectstore: mysql.c postgresql.c
geas/src/oql : oql.c
Log message:
changed internal field name "objectid" to "sys_id"
use localtime instead of localtime_r because localtime_r is not
portable enough
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/lib/classdefs/classdata.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.65&tr2=1.65.4.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/lib/classdefs/gcdparser.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.43.2.1&tr2=1.43.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/collectiondata.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.29.2.1&tr2=1.29.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/connection.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.65.4.1&tr2=1.65.4.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/dataobject.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.60.2.1&tr2=1.60.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/objectlist.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.29&tr2=1.29.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/query.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.12&tr2=1.12.4.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/transaction.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.12&tr2=1.12.4.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/objectcache/objectcache.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.58.2.1&tr2=1.58.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/objectstore/mysql.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.7&tr2=1.7.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/objectstore/postgresql.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.11&tr2=1.11.2.1&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/geas/src/oql/oql.c.diff?only_with_tag=geas-0-1-0-branch&tr1=1.65&tr2=1.65.4.1&r1=text&r2=text
Patches:
Index: gnue/geas/lib/classdefs/classdata.c
diff -u gnue/geas/lib/classdefs/classdata.c:1.64
gnue/geas/lib/classdefs/classdata.c:1.65
--- gnue/geas/lib/classdefs/classdata.c:1.64 Thu Jun 28 21:08:25 2001
+++ gnue/geas/lib/classdefs/classdata.c Thu Jul 5 18:38:09 2001
@@ -22,7 +22,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: classdata.c,v 1.64 2001/06/29 04:08:25 treshna Exp $
+ $Id: classdata.c,v 1.65 2001/07/06 01:38:09 ntiffin Exp $
*/
@@ -2450,7 +2450,7 @@
case IT_class:
if (item->filename != NULL)
{
- fprintf(out, "[%s]", g_basename(((odl_container *)item)->filename));
+ fprintf(out, " [%s]", g_basename(((odl_container *)item)->filename));
}
l = item->parents;
if (l)
Index: gnue/geas/lib/classdefs/gcdparser.c
diff -u gnue/geas/lib/classdefs/gcdparser.c:1.42
gnue/geas/lib/classdefs/gcdparser.c:1.43
--- gnue/geas/lib/classdefs/gcdparser.c:1.42 Wed Jul 4 11:04:12 2001
+++ gnue/geas/lib/classdefs/gcdparser.c Fri Aug 24 12:36:50 2001
@@ -21,7 +21,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: gcdparser.c,v 1.42 2001/07/04 18:04:12 ntiffin Exp $
+ $Id: gcdparser.c,v 1.43 2001/08/24 19:36:50 ntiffin Exp $
*/
@@ -233,41 +233,6 @@
assert (argument != NULL);
#endif
/* TODO - there must be something to do here, neilt */
-}
-
-/* ------------------------------------------------------------------------- *\
- * Allocate and make defaults for help structure.
-\* ------------------------------------------------------------------------- */
-struct _odl_help *
-alloc_odl_help ()
-{
- struct _odl_help *help_entry = g_new0 (struct _odl_help, 1);
- g_assert (help_entry != NULL);
- if (help_entry)
- {
- help_entry->module = NULL;
- help_entry->class = NULL;
- help_entry->field = NULL;
- help_entry->fullname = NULL;
- help_entry->language_code = NULL;
- help_entry->dialect_code = NULL;
- help_entry->help_text = NULL;
- help_entry->help_keywords = NULL;
- help_entry->tool_tip = NULL;
- help_entry->label = NULL;
- help_entry->default_text = NULL;
- }
- return help_entry;
-}
-
-/* ------------------------------------------------------------------------- *\
- *
-\* ------------------------------------------------------------------------- */
-void
-free_odl_help (struct _odl_item *help)
-{
- g_assert( help != NULL);
- /* TODO */
}
/* ------------------------------------------------------------------------- *\
Index: gnue/geas/src/collectiondata.c
diff -u gnue/geas/src/collectiondata.c:1.28 gnue/geas/src/collectiondata.c:1.29
--- gnue/geas/src/collectiondata.c:1.28 Mon Jun 25 20:01:25 2001
+++ gnue/geas/src/collectiondata.c Wed Jul 25 10:48:24 2001
@@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: collectiondata.c,v 1.28 2001/06/26 03:01:25 treshna Exp $
+ $Id: collectiondata.c,v 1.29 2001/07/25 17:48:24 reinhard Exp $
*/
@@ -239,9 +239,9 @@
// timer_update_profile( TIMER_FUNC_MAKELIST );
timer_done_operation( TIMER_LISTS );
- printf( "cache stats after list creation: " );
- oc_print_stats();
- printf( "\n" );
+ /* printf( "cache stats after list creation: " ); */
+ /* oc_print_stats(); */
+ /* printf( "\n" ); */
return (listid);
}
Index: gnue/geas/src/connection.c
diff -u gnue/geas/src/connection.c:1.64 gnue/geas/src/connection.c:1.65
--- gnue/geas/src/connection.c:1.64 Thu Jun 28 21:08:25 2001
+++ gnue/geas/src/connection.c Mon Jul 2 01:20:14 2001
@@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: connection.c,v 1.64 2001/06/29 04:08:25 treshna Exp $
+ $Id: connection.c,v 1.65 2001/07/02 08:20:14 treshna Exp $
*/
@@ -871,8 +871,8 @@
g_free (temp);
/* nasty, but hey, it should work */
- if( c->desc ) reverse = !reverse;
-
+/* if( c->desc ) reverse = !reverse;
+*/
temp = oc_get_object_field (ob, "logic");
if (temp[0] == '1')
logic = oql_and;
Index: gnue/geas/src/dataobject.c
diff -u gnue/geas/src/dataobject.c:1.59 gnue/geas/src/dataobject.c:1.60
--- gnue/geas/src/dataobject.c:1.59 Wed Jul 25 10:48:24 2001
+++ gnue/geas/src/dataobject.c Wed Jul 25 12:57:05 2001
@@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: dataobject.c,v 1.59 2001/07/25 17:48:24 reinhard Exp $
+ $Id: dataobject.c,v 1.60 2001/07/25 19:57:05 reinhard Exp $
*/
@@ -1137,7 +1137,7 @@
/* display arguments */
if (debuglevel >= DEBUGLEVEL_HIGH)
{
- int i;
+ unsigned int i;
for (i = 0; i < args->_length; i++)
debug_output (DEBUGLEVEL_ALWAYS, "Arg %2d: %s", i, args->_buffer[i]);
Index: gnue/geas/src/objectcache/objectcache.c
diff -u gnue/geas/src/objectcache/objectcache.c:1.57
gnue/geas/src/objectcache/objectcache.c:1.58
--- gnue/geas/src/objectcache/objectcache.c:1.57 Wed Jun 27 15:28:39 2001
+++ gnue/geas/src/objectcache/objectcache.c Wed Jul 25 08:40:18 2001
@@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: objectcache.c,v 1.57 2001/06/27 22:28:39 treshna Exp $
+ $Id: objectcache.c,v 1.58 2001/07/25 15:40:18 reinhard Exp $
*/
#include "config.h"
@@ -827,9 +827,6 @@
const char *value, gboolean readonly)
{
_FieldData *f;
- _ObjectData *o = object;
-
-/* printf( "setfield: %s/%s.%s = %s\n" , o->classname,o->key , fieldname ,
value ); */
timer_start_profile( TIMER_FUNC_SET_FIELD );
Index: gnue/geas/src/objectlist.c
diff -u gnue/geas/src/objectlist.c:1.28 gnue/geas/src/objectlist.c:1.29
--- gnue/geas/src/objectlist.c:1.28 Mon Jun 25 20:01:26 2001
+++ gnue/geas/src/objectlist.c Wed Jul 25 10:48:24 2001
@@ -20,7 +20,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: objectlist.c,v 1.28 2001/06/26 03:01:26 treshna Exp $
+ $Id: objectlist.c,v 1.29 2001/07/25 17:48:24 reinhard Exp $
*/
@@ -664,7 +664,6 @@
hacklist = (GList *)oc_get_object_userdata( ob );
hacklist2 = hacklist;
- printf( "should be %d objects, found %d\n" , length ,
g_list_length(hacklist2) );
while(hacklist2)
{
oc_remove_object( hacklist2->data );
Index: gnue/geas/src/objectstore/mysql.c
diff -u gnue/geas/src/objectstore/mysql.c:1.6
gnue/geas/src/objectstore/mysql.c:1.7
--- gnue/geas/src/objectstore/mysql.c:1.6 Wed Jul 25 05:51:08 2001
+++ gnue/geas/src/objectstore/mysql.c Wed Jul 25 08:40:18 2001
@@ -20,7 +20,7 @@
along with GEAS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: mysql.c,v 1.6 2001/07/25 12:51:08 reinhard Exp $
+ $Id: mysql.c,v 1.7 2001/07/25 15:40:18 reinhard Exp $
*/
#include "config.h"
@@ -660,7 +660,7 @@
gboolean remove_items, int *errorcode, char **errormsg)
{
char *name;
- GString *buf;
+ GString *buf = NULL;
DatabaseChange *changes = NULL;
GList *required = NULL;
GList *tmp;
Index: gnue/geas/src/objectstore/postgresql.c
diff -u gnue/geas/src/objectstore/postgresql.c:1.10
gnue/geas/src/objectstore/postgresql.c:1.11
--- gnue/geas/src/objectstore/postgresql.c:1.10 Mon Jun 25 20:01:26 2001
+++ gnue/geas/src/objectstore/postgresql.c Wed Jul 25 05:51:08 2001
@@ -20,7 +20,7 @@
along with GEAS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: postgresql.c,v 1.10 2001/06/26 03:01:26 treshna Exp $
+ $Id: postgresql.c,v 1.11 2001/07/25 12:51:08 reinhard Exp $
*/
#include "config.h"
@@ -663,7 +663,7 @@
for (row = 0; row < PQntuples (res); row++)
{
- char *name, *p;
+ char *name;
if (g_strcasecmp (PQgetvalue (res, row, 1), "VARCHAR") == 0)
type = DT_char;
@@ -690,20 +690,7 @@
else
type = DT_unknown;
- /* convert further double underscores to a single dot */
name = g_strdup (PQgetvalue (res, row, 0));
- for (p = strstr (name, "__"); p != NULL; p = strstr (name, "__"))
- {
- int size;
- void *src, *dest;
-
- *p = '.';
- src = p + 2;
- dest = p + 1;
- size = strlen (src) + 1;
- memmove (dest, src, size);
- }
-
add_database_column (tab, name, type);
g_free (name);
}
@@ -836,7 +823,8 @@
/* if column doesn't match a class field, report it as unnecessary */
/* if class doesn't match a table, record the table as required */
/* if data field doesn't match a column, record the column as required */
- changes = compare_classes_to_database (all_classes, required, database);
+ changes = compare_classes_to_database (all_classes, required, database,
+ OQL_DBTYPE_POSTGRESQL);
odl_namelist_free (required);
required = NULL;
Index: gnue/geas/src/oql/oql.c
diff -u gnue/geas/src/oql/oql.c:1.64 gnue/geas/src/oql/oql.c:1.65
--- gnue/geas/src/oql/oql.c:1.64 Thu Jun 28 21:08:25 2001
+++ gnue/geas/src/oql/oql.c Mon Jul 2 01:20:14 2001
@@ -19,7 +19,7 @@
along with GEAS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: oql.c,v 1.64 2001/06/29 04:08:25 treshna Exp $
+ $Id: oql.c,v 1.65 2001/07/02 08:20:14 treshna Exp $
*/
#include "config.h"
@@ -593,7 +593,7 @@
* else : if descending, then sort in descending order
*/
cl = odl_find_class( all_classes , loadclass , NULL );
- if ( (q->reversesearch && !cl->desc) || (!q->reversesearch && cl->desc) )
+ if ( (q->reversesearch) || (!q->reversesearch) ) /* commented out code
that didn't work, which was cl->desc */
g_string_append (buf, " DESC");
}
Index: gnue/geas/src/query.c
diff -u gnue/geas/src/query.c:1.11 gnue/geas/src/query.c:1.12
--- gnue/geas/src/query.c:1.11 Tue Jun 12 12:12:30 2001
+++ gnue/geas/src/query.c Thu Jun 28 21:08:25 2001
@@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: query.c,v 1.11 2001/06/12 19:12:30 reinhard Exp $
+ $Id: query.c,v 1.12 2001/06/29 04:08:25 treshna Exp $
*/
@@ -401,6 +401,7 @@
return;
}
GEAS_DataObject_setField (q, "classname", value, ev);
+
CORBA_Object_release (q, ev);
}
Index: gnue/geas/src/transaction.c
diff -u gnue/geas/src/transaction.c:1.11 gnue/geas/src/transaction.c:1.12
--- gnue/geas/src/transaction.c:1.11 Sat Jun 2 06:17:10 2001
+++ gnue/geas/src/transaction.c Thu Jun 7 16:37:05 2001
@@ -19,7 +19,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: transaction.c,v 1.11 2001/06/02 13:17:10 ntiffin Exp $
+ $Id: transaction.c,v 1.12 2001/06/07 23:37:05 ntiffin Exp $
*/
@@ -42,497 +42,544 @@
/* factory methods */
GEAS_Transaction
-TransactionFactory_new( GEAS_object_reference *id , CORBA_Environment *ev )
+TransactionFactory_new (GEAS_object_reference * id, CORBA_Environment * ev)
{
- GEAS_Transaction retval = CORBA_OBJECT_NIL;
- GEAS_DataObject obj = CORBA_OBJECT_NIL;
- char *newid;
-
- /* Create a new transaction */
- obj = GEAS_Connection_newObject( id->server,"geas::transaction",ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- return( CORBA_OBJECT_NIL );
- }
- GEAS_DataObject_setField(obj,"_user",id->username,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- GEAS_DataObject_delete(obj,ev);
- CORBA_Object_release(obj,ev);
- return( CORBA_OBJECT_NIL );
- }
-
- GEAS_DataObject_setField(obj,"open","F",ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- GEAS_DataObject_delete(obj,ev);
- CORBA_Object_release(obj,ev);
- return( CORBA_OBJECT_NIL );
- }
-
- newid = GEAS_DataObject__get_objectID(obj,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- GEAS_DataObject_delete(obj,ev);
- CORBA_Object_release(obj,ev);
- return( CORBA_OBJECT_NIL );
- }
-
- retval = make_transaction_reference( id->username , newid , id->sessionid ,
ev );
- CORBA_free( newid );
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- GEAS_DataObject_delete(obj,ev);
- CORBA_Object_release(obj,ev);
- return( CORBA_OBJECT_NIL );
- }
+ GEAS_Transaction retval = CORBA_OBJECT_NIL;
+ GEAS_DataObject obj = CORBA_OBJECT_NIL;
+ char *newid;
+
+ /* Create a new transaction */
+ obj = GEAS_Connection_newObject (id->server, "geas::transaction", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ return (CORBA_OBJECT_NIL);
+ }
+ GEAS_DataObject_setField (obj, "_user", id->username, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ GEAS_DataObject_delete (obj, ev);
+ CORBA_Object_release (obj, ev);
+ return (CORBA_OBJECT_NIL);
+ }
+
+ GEAS_DataObject_setField (obj, "open", "F", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ GEAS_DataObject_delete (obj, ev);
+ CORBA_Object_release (obj, ev);
+ return (CORBA_OBJECT_NIL);
+ }
+
+ newid = GEAS_DataObject__get_objectID (obj, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ GEAS_DataObject_delete (obj, ev);
+ CORBA_Object_release (obj, ev);
+ return (CORBA_OBJECT_NIL);
+ }
+
+ retval =
+ make_transaction_reference (id->username, newid, id->sessionid, ev);
+ CORBA_free (newid);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ GEAS_DataObject_delete (obj, ev);
+ CORBA_Object_release (obj, ev);
+ return (CORBA_OBJECT_NIL);
+ }
- CORBA_Object_release(obj,ev);
- return( retval );
+ CORBA_Object_release (obj, ev);
+ return (retval);
}
GEAS_Transaction
-TransactionFactory_current( GEAS_object_reference *id , CORBA_Environment *ev )
+TransactionFactory_current (GEAS_object_reference * id,
+ CORBA_Environment * ev)
{
- GEAS_Transaction retval = CORBA_OBJECT_NIL;
- GEAS_DataObject user;
- char *tid;
-
- /* Find the transaction that the current user is associated with */
-
- /* find the user */
- user = GEAS_Connection_loadSingleObject( id->server,
-
"geas::user","username",id->username,ev);
- if( ev->_major != CORBA_NO_EXCEPTION || user == CORBA_OBJECT_NIL )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- return( CORBA_OBJECT_NIL );
- }
-
- /* get transaction object */
- tid = GEAS_DataObject_getField(user,"_currenttransaction",ev);
- if( ev->_major != CORBA_NO_EXCEPTION || tid == NULL )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_Object_release(user,ev);
- if( tid )
- CORBA_free(tid);
- return( CORBA_OBJECT_NIL );
- }
-
- retval = make_transaction_reference( id->username , tid , id->sessionid ,
ev );
- CORBA_free(tid);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_Object_release(user,ev);
- return( CORBA_OBJECT_NIL );
- }
+ GEAS_Transaction retval = CORBA_OBJECT_NIL;
+ GEAS_DataObject user;
+ char *tid;
+
+ /* Find the transaction that the current user is associated with */
+
+ /* find the user */
+ user = GEAS_Connection_loadSingleObject (id->server,
+ "geas::user", "username",
+ id->username, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION || user == CORBA_OBJECT_NIL)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ return (CORBA_OBJECT_NIL);
+ }
+
+ /* get transaction object */
+ tid = GEAS_DataObject_getField (user, "_currenttransaction", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION || tid == NULL)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_Object_release (user, ev);
+ if (tid)
+ CORBA_free (tid);
+ return (CORBA_OBJECT_NIL);
+ }
- CORBA_Object_release(user,ev);
- return( retval );
+ retval = make_transaction_reference (id->username, tid, id->sessionid, ev);
+ CORBA_free (tid);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_Object_release (user, ev);
+ return (CORBA_OBJECT_NIL);
+ }
+
+ CORBA_Object_release (user, ev);
+ return (retval);
}
/* transaction methods */
/* raises: TransactionInProgress, DatabaseClosed */
-void Transaction_begin( GEAS_object_reference *id , CORBA_Environment *ev )
+void
+Transaction_begin (GEAS_object_reference * id, CORBA_Environment * ev)
{
- GEAS_DataObject transaction;
- GEAS_DataObject user;
- char *open;
- char *transactionid = NULL;
-
- /* find record */
- transaction = GEAS_Connection_loadSingleObject( id->server,
- "geas::transaction",
- "objectid",id->objectid,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- }
-
- /* check it's closed */
- open = GEAS_DataObject_getField( transaction , "open" , ev );
- if( ev->_major != CORBA_NO_EXCEPTION || strcmp(open,"T")==0 )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionInProgress_exception(ev,"");
- return;
- }
-
- /* get its identifier */
- transactionid = GEAS_DataObject__get_objectID( transaction , ev );
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionInProgress_exception(ev,"");
- return;
- }
-
- /* mark it as open */
- GEAS_DataObject_setField(transaction,"open","T",ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions, really */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
- if( transactionid ) CORBA_free( transactionid );
-
- /* send a generic 'no can do' error */
- make_TransactionInProgress_exception(ev,"");
- return;
- }
- CORBA_free(open);
-
- /* make it the 'current' transaction for user 'id->username' */
- user = GEAS_Connection_loadSingleObject(get_server_connection_object(),
- "geas::user","username",
- id->username,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- printf( "eep? another error handler TODO %s/%s\n" , __FILE__ , __LINE__
);
- exit(0);
- }
- GEAS_DataObject_setField(user,"_currenttransaction",transactionid,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- printf( "eep? another error handler TODO %s/%s\n" , __FILE__ , __LINE__
);
- exit(0);
- }
- CORBA_Object_release( user , ev );
-
- /* done */
- dm_event(id->username,transactionid,DM_TRANSACTION_BEGIN);
- if( transactionid ) CORBA_free( transactionid );
- CORBA_Object_release( transaction , ev );
+ GEAS_DataObject transaction;
+ GEAS_DataObject user;
+ char *open;
+ char *transactionid = NULL;
+
+ /* find record */
+ transaction = GEAS_Connection_loadSingleObject (id->server,
+ "geas::transaction",
+ "objectid", id->objectid,
+ ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ }
+
+ /* check it's closed */
+ open = GEAS_DataObject_getField (transaction, "open", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION || strcmp (open, "T") == 0)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionInProgress_exception (ev, "");
+ return;
+ }
+
+ /* get its identifier */
+ transactionid = GEAS_DataObject__get_objectID (transaction, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionInProgress_exception (ev, "");
+ return;
+ }
+
+ /* mark it as open */
+ GEAS_DataObject_setField (transaction, "open", "T", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions, really */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+ if (transactionid)
+ CORBA_free (transactionid);
+
+ /* send a generic 'no can do' error */
+ make_TransactionInProgress_exception (ev, "");
+ return;
+ }
+ CORBA_free (open);
+
+ /* make it the 'current' transaction for user 'id->username' */
+ user = GEAS_Connection_loadSingleObject (get_server_connection_object (),
+ "geas::user", "username",
+ id->username, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ printf ("eep? another error handler TODO %s/%d\n", __FILE__, __LINE__);
+ exit (0);
+ }
+ GEAS_DataObject_setField (user, "_currenttransaction", transactionid, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ printf ("eep? another error handler TODO %s/%d\n", __FILE__, __LINE__);
+ exit (0);
+ }
+ CORBA_Object_release (user, ev);
+
+ /* done */
+ dm_event (id->username, transactionid, DM_TRANSACTION_BEGIN);
+ if (transactionid)
+ {
+ CORBA_free (transactionid);
+ }
+ CORBA_Object_release (transaction, ev);
}
/* raises: TransactionNotInProgress */
-void Transaction_commit( GEAS_object_reference *id , CORBA_Environment *ev )
+void
+Transaction_commit (GEAS_object_reference * id, CORBA_Environment * ev)
{
- GEAS_DataObject transaction,user;
- char *open;
- char *transactionid;
-
- transaction = GEAS_Connection_loadSingleObject( id->server,
- "geas::transaction",
- "objectid",id->objectid,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- }
-
- /* check it's open */
- open = GEAS_DataObject_getField( transaction , "open" , ev );
- if( ev->_major != CORBA_NO_EXCEPTION || strcmp(open,"T")!=0 )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionNotInProgress_exception(ev,"");
- return;
- }
- CORBA_free(open);
-
- /* get its identifier */
- transactionid = GEAS_DataObject__get_objectID( transaction , ev );
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionNotInProgress_exception(ev,"");
- return;
- }
-
- /* commit transaction now */
- dm_event(id->username,transactionid,DM_TRANSACTION_COMMIT);
- CORBA_free(transactionid);
-
- /* mark it as closed */
- GEAS_DataObject_setField(transaction,"open","F",ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions, really */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- return;
- }
-
- /* clear the 'current' transaction for user 'id->username' */
- user = GEAS_Connection_loadSingleObject(get_server_connection_object(),
- "geas::user","username",
- id->username,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- printf( "eep? another error handler TODO %s/%s\n" , __FILE__ , __LINE__
);
- exit(0);
- }
- GEAS_DataObject_setField(user,"_currenttransaction","",ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- printf( "eep? another error handler TODO %s/%s\n" , __FILE__ , __LINE__
);
- exit(0);
- }
- CORBA_Object_release( user , ev );
+ GEAS_DataObject transaction, user;
+ char *open;
+ char *transactionid;
+
+ transaction = GEAS_Connection_loadSingleObject (id->server,
+ "geas::transaction",
+ "objectid", id->objectid,
+ ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ }
+
+ /* check it's open */
+ open = GEAS_DataObject_getField (transaction, "open", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION || strcmp (open, "T") != 0)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionNotInProgress_exception (ev, "");
+ return;
+ }
+ CORBA_free (open);
+
+ /* get its identifier */
+ transactionid = GEAS_DataObject__get_objectID (transaction, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionNotInProgress_exception (ev, "");
+ return;
+ }
- /* done */
- CORBA_Object_release( transaction , ev );
+ /* commit transaction now */
+ dm_event (id->username, transactionid, DM_TRANSACTION_COMMIT);
+ CORBA_free (transactionid);
+
+ /* mark it as closed */
+ GEAS_DataObject_setField (transaction, "open", "F", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions, really */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ return;
+ }
+
+ /* clear the 'current' transaction for user 'id->username' */
+ user = GEAS_Connection_loadSingleObject (get_server_connection_object (),
+ "geas::user", "username",
+ id->username, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ printf ("eep? another error handler TODO %s/%d\n", __FILE__, __LINE__);
+ exit (0);
+ }
+ GEAS_DataObject_setField (user, "_currenttransaction", "", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ printf ("eep? another error handler TODO %s/%d\n", __FILE__, __LINE__);
+ exit (0);
+ }
+ CORBA_Object_release (user, ev);
+
+ /* done */
+ CORBA_Object_release (transaction, ev);
}
/* raises: TransactionNotInProgress */
-void Transaction_abort( GEAS_object_reference *id , CORBA_Environment *ev )
+void
+Transaction_abort (GEAS_object_reference * id, CORBA_Environment * ev)
{
- GEAS_DataObject transaction,user;
- char *open;
- char *transactionid;
-
- transaction = GEAS_Connection_loadSingleObject( id->server,
- "geas::transaction",
- "objectid",id->objectid,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- }
-
- /* check it's open */
- open = GEAS_DataObject_getField( transaction , "open" , ev );
- if( ev->_major != CORBA_NO_EXCEPTION || strcmp(open,"T")!=0 )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionNotInProgress_exception(ev,"");
- return;
- }
- CORBA_free(open);
-
- /* get its identifier */
- transactionid = GEAS_DataObject__get_objectID( transaction , ev );
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionNotInProgress_exception(ev,"");
- return;
- }
-
- /* abort/rollback transaction now */
- dm_event(id->username,transactionid,DM_TRANSACTION_ROLLBACK);
- CORBA_free(transactionid);
-
- /* mark it as closed */
- GEAS_DataObject_setField(transaction,"open","F",ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions, really */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- return;
- }
-
- /* clear the 'current' transaction for user 'id->username' */
- user = GEAS_Connection_loadSingleObject(get_server_connection_object(),
- "geas::user","username",
- id->username,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- printf( "eep? another error handler TODO %s/%s\n" , __FILE__ , __LINE__
);
- exit(0);
- }
- GEAS_DataObject_setField(user,"_currenttransaction","",ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- printf( "eep? another error handler TODO %s/%s\n" , __FILE__ , __LINE__
);
- exit(0);
- }
- CORBA_Object_release( user , ev );
+ GEAS_DataObject transaction, user;
+ char *open;
+ char *transactionid;
+
+ transaction = GEAS_Connection_loadSingleObject (id->server,
+ "geas::transaction",
+ "objectid", id->objectid,
+ ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ }
- /* done */
- CORBA_Object_release( transaction , ev );
+ /* check it's open */
+ open = GEAS_DataObject_getField (transaction, "open", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION || strcmp (open, "T") != 0)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionNotInProgress_exception (ev, "");
+ return;
+ }
+ CORBA_free (open);
+
+ /* get its identifier */
+ transactionid = GEAS_DataObject__get_objectID (transaction, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionNotInProgress_exception (ev, "");
+ return;
+ }
+
+ /* abort/rollback transaction now */
+ dm_event (id->username, transactionid, DM_TRANSACTION_ROLLBACK);
+ CORBA_free (transactionid);
+
+ /* mark it as closed */
+ GEAS_DataObject_setField (transaction, "open", "F", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions, really */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ return;
+ }
+
+ /* clear the 'current' transaction for user 'id->username' */
+ user = GEAS_Connection_loadSingleObject (get_server_connection_object (),
+ "geas::user", "username",
+ id->username, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ printf ("eep? another error handler TODO %s/%d\n", __FILE__, __LINE__);
+ exit (0);
+ }
+ GEAS_DataObject_setField (user, "_currenttransaction", "", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ printf ("eep? another error handler TODO %s/%d\n", __FILE__, __LINE__);
+ exit (0);
+ }
+ CORBA_Object_release (user, ev);
+
+ /* done */
+ CORBA_Object_release (transaction, ev);
}
/* raises: TransactionNotInProgress */
-void Transaction_checkpoint( GEAS_object_reference *id , CORBA_Environment *ev
)
+void
+Transaction_checkpoint (GEAS_object_reference * id, CORBA_Environment * ev)
{
- GEAS_DataObject transaction;
- char *open;
- char *transactionid;
-
- transaction = GEAS_Connection_loadSingleObject( id->server,
- "geas::transaction",
- "objectid",id->objectid,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- }
-
- /* check it's open */
- open = GEAS_DataObject_getField( transaction , "open" , ev );
- if( ev->_major != CORBA_NO_EXCEPTION || strcmp(open,"T")!=0 )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionNotInProgress_exception(ev,"");
- return;
- }
- CORBA_free(open);
-
- /* get its identifier */
- transactionid = GEAS_DataObject__get_objectID( transaction , ev );
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_free(open);
- CORBA_Object_release( transaction , ev );
-
- /* send a generic 'no can do' error */
- make_TransactionNotInProgress_exception(ev,"");
- return;
- }
-
- /* checkpoint transaction now */
- dm_event(id->username,transactionid,DM_TRANSACTION_CHECKPOINT);
- CORBA_free(transactionid);
+ GEAS_DataObject transaction;
+ char *open;
+ char *transactionid;
+
+ transaction = GEAS_Connection_loadSingleObject (id->server,
+ "geas::transaction",
+ "objectid", id->objectid,
+ ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ }
+
+ /* check it's open */
+ open = GEAS_DataObject_getField (transaction, "open", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION || strcmp (open, "T") != 0)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionNotInProgress_exception (ev, "");
+ return;
+ }
+ CORBA_free (open);
+
+ /* get its identifier */
+ transactionid = GEAS_DataObject__get_objectID (transaction, ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_free (open);
+ CORBA_Object_release (transaction, ev);
+
+ /* send a generic 'no can do' error */
+ make_TransactionNotInProgress_exception (ev, "");
+ return;
+ }
- /* leave it open */
+ /* checkpoint transaction now */
+ dm_event (id->username, transactionid, DM_TRANSACTION_CHECKPOINT);
+ CORBA_free (transactionid);
- /* done */
- CORBA_Object_release( transaction , ev );
+ /* leave it open */
+
+ /* done */
+ CORBA_Object_release (transaction, ev);
}
/* raises: TransactionNotInProgress */
-void Transaction_join( GEAS_object_reference *id , CORBA_Environment *ev )
+void
+Transaction_join (GEAS_object_reference * id, CORBA_Environment * ev)
{
}
/* raises: TransactionNotInProgress */
-void Transaction_leave( GEAS_object_reference *id , CORBA_Environment *ev )
+void
+Transaction_leave (GEAS_object_reference * id, CORBA_Environment * ev)
{
}
-CORBA_boolean Transaction_isOpen( GEAS_object_reference *id ,
CORBA_Environment *ev )
+CORBA_boolean
+Transaction_isOpen (GEAS_object_reference * id, CORBA_Environment * ev)
{
- GEAS_DataObject transaction;
- char *open;
- CORBA_boolean retval;
-
- transaction = GEAS_Connection_loadSingleObject( id->server,
- "geas::transaction",
- "objectid",id->objectid,ev);
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- }
- open = GEAS_DataObject_getField( transaction , "open" , ev );
- if( ev->_major != CORBA_NO_EXCEPTION )
- {
- /* ignore exceptions */
- message( "error : %s (%s,%d)" ,
CORBA_exception_id(ev),__FILE__,__LINE__ );
- CORBA_exception_free(ev);
- CORBA_exception_init(ev);
- CORBA_Object_release( transaction , ev );
-
- /* an error, so we can't be active */
- return( CORBA_FALSE );
- }
-
- CORBA_Object_release( transaction , ev );
- if( open[0] == 'T' ) retval = CORBA_TRUE;
- else retval = CORBA_FALSE;
+ GEAS_DataObject transaction;
+ char *open;
+ CORBA_boolean retval;
+
+ transaction = GEAS_Connection_loadSingleObject (id->server,
+ "geas::transaction",
+ "objectid", id->objectid,
+ ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ }
+ open = GEAS_DataObject_getField (transaction, "open", ev);
+ if (ev->_major != CORBA_NO_EXCEPTION)
+ {
+ /* ignore exceptions */
+ message ("error : %s (%s,%d)", CORBA_exception_id (ev), __FILE__,
+ __LINE__);
+ CORBA_exception_free (ev);
+ CORBA_exception_init (ev);
+ CORBA_Object_release (transaction, ev);
- CORBA_free(open);
- return( retval );
-}
+ /* an error, so we can't be active */
+ return (CORBA_FALSE);
+ }
+ CORBA_Object_release (transaction, ev);
+ if (open[0] == 'T')
+ {
+ retval = CORBA_TRUE;
+ }
+ else
+ {
+ retval = CORBA_FALSE;
+ }
+ CORBA_free (open);
+ return (retval);
+}
- gnue/geas lib/classdefs/classdata.c lib/classde...,
Reinhard Mueller <=