Esempio n. 1
0
        /// <summary>make sure this Db4oDatabase is stored.</summary>
        /// <remarks>make sure this Db4oDatabase is stored. Return the ID.</remarks>
        public virtual int Bind(Transaction trans)
        {
            ObjectContainerBase stream = trans.Container();

            Db4objects.Db4o.Ext.Db4oDatabase stored = (Db4objects.Db4o.Ext.Db4oDatabase)stream
                                                      .Db4oTypeStored(trans, this);
            if (stored == null)
            {
                return(StoreAndGetId(trans));
            }
            if (stored == this)
            {
                return(stream.GetID(trans, this));
            }
            if (i_uuid == 0)
            {
                i_uuid = stored.i_uuid;
            }
            stream.ShowInternalClasses(true);
            try
            {
                int id = stream.GetID(trans, stored);
                stream.Bind(trans, this, id);
                return(id);
            }
            finally
            {
                stream.ShowInternalClasses(false);
            }
        }