Menu

Using transaction logging

Help
fpdeguzman
2008-04-16
2013-04-09
  • fpdeguzman

    fpdeguzman - 2008-04-16

    hi, do you have any idea on how to enable transation logging?
    my database crushed and cant recover it becuase it has no transaction.
    thank you very much!
    regards.

     
    • Karl Waclawek

      Karl Waclawek - 2008-04-16

      You must enable transactions before the crash. Now it won't help you anymore, your database cannot be restored without the log from before the crash.

      Anyway, look at the flags for opening an environment or database.

      Karl

       
      • fpdeguzman

        fpdeguzman - 2008-04-23

        hi, i was able to set the transaction successfully.
        thank you very much!
        have a nice day. =)

         
    • fpdeguzman

      fpdeguzman - 2008-04-18

      hi, thank you very much for the reply.
      i look into opening the database with an environment. unfortunately im encountering this berkeley exception "Invalid argument". the code goes like this.

                  Env dbEnv = new Env(EnvCreateFlags.None); ;

                  dbEnv.ErrorPrefix = "Env_Err";
                  dbEnv.ErrorStream = new FileStream(System.IO.Path.Combine(dbPath, "Env_Err"),
                      FileMode.OpenOrCreate, FileAccess.ReadWrite);

                  dbEnv.Open(dbPath, Env.OpenFlags.Create | Env.OpenFlags.InitLog
                      | Env.OpenFlags.InitMPool | Env.OpenFlags.InitTxn, 0);

                  Db db = new Db(dbEnv, this.dbCreate);
                  db.ErrorPrefix = "Db_Err";

                  DbFile dbFile = db.Open(null, "Db", null, BerkeleyDb.DbType.BTree,
      Db.OpenFlags.Create, 0);

       
      • fpdeguzman

        fpdeguzman - 2008-04-18

        im sorry about that, i accidentally press the Post Comment button.
        the following is the complete code.

        Env dbEnv = new Env(EnvCreateFlags.None); ;

        dbEnv.ErrorPrefix = "Env_Err";
        dbEnv.ErrorStream = new FileStream(System.IO.Path.Combine(dbPath, "Env_Err"),
        FileMode.OpenOrCreate, FileAccess.ReadWrite);

        dbEnv.Open(dbPath, Env.OpenFlags.Create | Env.OpenFlags.InitLog
        | Env.OpenFlags.InitMPool | Env.OpenFlags.InitTxn, 0);

        Db db = new Db(dbEnv, this.dbCreate);
        db.ErrorPrefix = "Db_Err";

        DbFile dbFile = db.Open(null, "Db", null, BerkeleyDb.DbType.BTree,
        Db.OpenFlags.Create | Db.OpenFlags.AutoCommit, 0);

        the error occurs in the db.Open. am i missing some flags?
        maybe if you could please help me out. thank you very much!
        have a nice day.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.