Пример #1
0
 public XbimGeometryCursor(EsentModel model, string database, OpenDatabaseGrbit mode)
     : base(model, database, mode)
 {
     Api.JetOpenTable(Sesid, DbId, GeometryTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                      mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None,
                      out Table);
     InitColumns();
 }
 public XbimShapeGeometryCursor(XbimModel model, string database, OpenDatabaseGrbit mode)
     : base(model, database, mode)
 {
     Api.JetOpenTable(this.sesid, this.dbId, GeometryTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                                                                         mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None,
                                                                         out this.table);
     InitColumns();
 }
 public EsentShapeInstanceCursor(EsentModel model, string database, OpenDatabaseGrbit mode)
     : base(model, database, mode)
 {
     Api.JetOpenTable(this.Sesid, this.DbId, InstanceTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                      mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None,
                      out this.Table);
     InitColumns();
 }
 public XbimShapeGeometryCursor(XbimModel model, string database, OpenDatabaseGrbit mode)
     : base(model, database, mode)
 {
     Api.JetOpenTable(this.sesid, this.dbId, GeometryTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                      mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None,
                      out this.table);
     InitColumns();
 }
Пример #5
0
 /// <summary>
 /// Opens a database previously attached with <see cref="JetAttachDatabase"/>,
 /// for use with a database session. This function can be called multiple times
 /// for the same database.
 /// </summary>
 /// <param name="sesid">The session that is opening the database.</param>
 /// <param name="database">The database to open.</param>
 /// <param name="dbid">Returns the dbid of the attached database.</param>
 /// <param name="grbit">Open database options.</param>
 /// <returns>An ESENT warning code.</returns>
 public static JET_wrn OpenDatabase(
     JET_SESID sesid,
     string database,
     out JET_DBID dbid,
     OpenDatabaseGrbit grbit)
 {
     return(Api.JetOpenDatabase(sesid, database, null, out dbid, grbit));
 }
Пример #6
0
 public void OpenDatabase(string connect, OpenDatabaseGrbit grbit)
 {
     if (JetDbid != JET_DBID.Nil)
     {
         throw new ApplicationException("Only one database may be opened in an EsentSession");
     }
     JET_DBID dbid;
     Api.JetOpenDatabase(_session, Database.DatabasePath, connect, out dbid, grbit);
     JetDbid = dbid;
 }
Пример #7
0
 /// <summary>
 /// Constructs a table and opens it
 /// </summary>
 /// <param name="instance"></param>
 /// <param name="database"></param>
 public EsentEntityCursor(EsentModel model, string database, OpenDatabaseGrbit mode)
     : base(model, database, mode)
 {
     Api.JetOpenTable(Sesid, DbId, ifcEntityTableName, null, 0,
                      mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                      mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out Table);
     Api.JetOpenTable(Sesid, DbId, ifcEntityIndexTableName, null, 0,
                      mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                      mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out _indexTable);
     InitColumns();
 }
Пример #8
0
        /// <summary>
        /// Initializes a new instance of the ConnectionBase class.
        /// </summary>
        /// <param name="instance">The instance to use for the connection.</param>
        /// <param name="name">The name of the connection.</param>
        /// <param name="database">The database to be connected do.</param>
        /// <param name="grbit">The option to open the database with.</param>
        protected ConnectionBase(Instance instance, string name, string database, OpenDatabaseGrbit grbit)
        {
            this.Tracer = new Tracer("Connection", "Esent Connection", String.Format("Connection {0}", name));

            this.Name = name;
            this.Database = database;
            this.openedTables = new List<Table>();

            this.session = new Session(instance);
            Api.JetAttachDatabase(this.session, database, AttachDatabaseGrbit.None);
            Api.JetOpenDatabase(this.session, this.Database, String.Empty, out this.dbid, grbit);

            this.Tracer.TraceInfo("created. (database '{0}')", this.Database);
        }
Пример #9
0
        /// <summary>
        /// Initializes a new instance of the ConnectionBase class.
        /// </summary>
        /// <param name="instance">The instance to use for the connection.</param>
        /// <param name="name">The name of the connection.</param>
        /// <param name="database">The database to be connected do.</param>
        /// <param name="grbit">The option to open the database with.</param>
        protected ConnectionBase(Instance instance, string name, string database, OpenDatabaseGrbit grbit)
        {
            this.Tracer = new Tracer("Connection", "Esent Connection", String.Format("Connection {0}", name));

            this.Name         = name;
            this.Database     = database;
            this.openedTables = new List <Table>();

            this.session = new Session(instance);
            Api.JetAttachDatabase(this.session, database, AttachDatabaseGrbit.None);
            Api.JetOpenDatabase(this.session, this.Database, String.Empty, out this.dbid, grbit);

            this.Tracer.TraceInfo("created. (database '{0}')", this.Database);
        }
Пример #10
0
 public XbimCursor(XbimModel model, string database,  OpenDatabaseGrbit mode)
 {
     this.lockObject = new Object();
     this.model = model;
     this.instance = model.Cache.JetInstance;
     sesid = new Session(instance);
     Api.JetOpenDatabase(sesid, database, String.Empty, out this.dbId, mode);
     Api.JetOpenTable(this.sesid, this.dbId, globalsTableName, null, 0,  mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : 
                                                                         mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, 
                                                                         out this.globalsTable);
     this.entityCountColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, entityCountColumnName);
     this.geometryCountColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, geometryCountColumnName);
     this.flushColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, flushColumnName);
     this.ifcHeaderColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, ifcHeaderColumnName);
     ReadOnly = (mode == OpenDatabaseGrbit.ReadOnly);
 }
Пример #11
0
 protected EsentCursor(EsentModel model, string database, OpenDatabaseGrbit mode)
 {
     LockObject = new Object();
     Model      = model;
     Instance   = model.Cache.JetInstance;
     Sesid      = new Session(Instance);
     Api.JetOpenDatabase(Sesid, database, String.Empty, out DbId, mode);
     Api.JetOpenTable(Sesid, DbId, GlobalsTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                      mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None,
                      out GlobalsTable);
     EntityCountColumn   = Api.GetTableColumnid(Sesid, GlobalsTable, EntityCountColumnName);
     GeometryCountColumn = Api.GetTableColumnid(Sesid, GlobalsTable, GeometryCountColumnName);
     FlushColumn         = Api.GetTableColumnid(Sesid, GlobalsTable, FlushColumnName);
     IfcHeaderColumn     = Api.GetTableColumnid(Sesid, GlobalsTable, ifcHeaderColumnName);
     ReadOnly            = (mode == OpenDatabaseGrbit.ReadOnly);
 }
Пример #12
0
 public XbimCursor(XbimModel model, string database, OpenDatabaseGrbit mode)
 {
     this.lockObject = new Object();
     this.model      = model;
     this.instance   = model.Cache.JetInstance;
     sesid           = new Session(instance);
     Api.JetOpenDatabase(sesid, database, String.Empty, out this.dbId, mode);
     Api.JetOpenTable(this.sesid, this.dbId, globalsTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly :
                      mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None,
                      out this.globalsTable);
     this.entityCountColumn   = Api.GetTableColumnid(this.sesid, this.globalsTable, entityCountColumnName);
     this.geometryCountColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, geometryCountColumnName);
     this.flushColumn         = Api.GetTableColumnid(this.sesid, this.globalsTable, flushColumnName);
     this.ifcHeaderColumn     = Api.GetTableColumnid(this.sesid, this.globalsTable, ifcHeaderColumnName);
     ReadOnly = (mode == OpenDatabaseGrbit.ReadOnly);
 }
Пример #13
0
 /// <summary>
 /// Opens a database previously attached with <see cref="JetAttachDatabase"/>,
 /// for use with a database session. This function can be called multiple times
 /// for the same database.
 /// </summary>
 /// <param name="sesid">The session that is opening the database.</param>
 /// <param name="database">The database to open.</param>
 /// <param name="dbid">Returns the dbid of the attached database.</param>
 /// <param name="grbit">Open database options.</param>
 /// <returns>An ESENT warning code.</returns>
 public static JET_wrn OpenDatabase(
     JET_SESID sesid,
     string database,
     out JET_DBID dbid,
     OpenDatabaseGrbit grbit)
 {
     return Api.JetOpenDatabase(sesid, database, null, out dbid, grbit);
 }
Пример #14
0
 /// <summary>
 /// Opens a database previously attached with <see cref="JetAttachDatabase"/>,
 /// for use with a database session. This function can be called multiple times
 /// for the same database.
 /// </summary>
 /// <param name="sesid">The session that is opening the database.</param>
 /// <param name="database">The database to open.</param>
 /// <param name="connect">Reserved for future use.</param>
 /// <param name="dbid">Returns the dbid of the attached database.</param>
 /// <param name="grbit">Open database options.</param>
 /// <returns>An ESENT warning code.</returns>
 public static JET_wrn JetOpenDatabase(JET_SESID sesid, string database, string connect, out JET_DBID dbid, OpenDatabaseGrbit grbit)
 {
     return Api.Check(Impl.JetOpenDatabase(sesid, database, connect, out dbid, grbit));
 }
Пример #15
0
 public static void OpenDatabase(this IEsentSession session, OpenDatabaseGrbit grbit)
 {
     session.OpenDatabase(null,grbit);
 }