Archived

This forum has been archived. Please start a new discussion on GitHub.

how can i set the value of env-name?

something about Freeze.DbEnv.env-name.xxx of Freeze Properties in my ICE config file.

i can create a connection like this:
Freeze::createConnection(_communicator, "opt/btsys/");
"/opt/btsys/" is the env-name here. am i right?

for example, my data file are stored in /opt/btsys/ (absolute pathname), and there are several freeze maps in this directory. what's the corresponding env-name? is Freeze.DbEnv./opt/btsys/.xxx ok? i just don't know how to do this in my config file.

Comments

  • i tried like this
    Freeze.DbEnv.bt.DbHome=/opt/btsys/
    Freeze.DbEnv.bt.DbPrivate=0
    

    then i started my program, but i could not find __db.xxx in /opt/btsys/

    i want to use db_stat(or db45_stat) utility of BDB, how can i achieve this?
  • benoit
    benoit Rennes, France
    Hi,

    Yes, by default, the location of the database environment home directory is the environment name. However, you can use a simpler environment name and set the Freeze.DbEnv.env‑name.DbHome property instead (for example, you can use "MyDB" as the environment name and set Freeze.DbEnv.MyDB.DbHome to "/opt/btsys").

    See the Ice manual for more information.

    Cheers,
    Benoit.
  • benoit
    benoit Rennes, France
    You can use the -h option to specify the location of the database environment with db_stat.

    Cheers,
    Benoit.
  • benoit wrote: »
    You can use the -h option to specify the location of the database environment with db_stat.

    Cheers,
    Benoit.

    i use this command line:
    db_stat -h /opt/btsys -m
    

    error occurs: db_stat: DB_ENV->open: /opt/btsys: No such file or directory. but i am quite sure the directory exists and permissions are ok.
  • benoit
    benoit Rennes, France
    That's most likely because the database environment files don't exist in the directory pointed by the "-h" option.

    You need to run your Freeze server (with the Freeze.DbEnv.<dbenv>.DbPrivate property set to 0) first in order to be able to run db_stat. I recommend looking at the BerkeleyDB documentation for more information.

    Cheers,
    Benoit.
  • benoit wrote: »
    That's most likely because the database environment files don't exist in the directory pointed by the "-h" option.

    You need to run your Freeze server (with the Freeze.DbEnv.<dbenv>.DbPrivate property set to 0) first in order to be able to run db_stat. I recommend looking at the BerkeleyDB documentation for more information.

    Cheers,
    Benoit.

    i do it like this
    Freeze.DbEnv.bt.DbHome=/opt/btsys/
    Freeze.DbEnv.bt.DbPrivate=0
    

    but still no effect
  • benoit
    benoit Rennes, France
    Is your Freeze application also running when you run db_stat? Do you have files prefixed with "__db.00" in the database environment directory?

    Cheers,
    Benoit.
  • benoit wrote: »
    Is your Freeze application also running when you run db_stat? Do you have files prefixed with "__db.00" in the database environment directory?

    Cheers,
    Benoit.

    1.yes. my application is running when i run db_stat

    2.no. there are no such files (__db.xxx) in my database environment directory.
  • benoit
    benoit Rennes, France
    If you don't have these files, it most likely indicates that your database environment is still private. How do you create the Freeze connection in your program? Are you correctly using "bt" for the database environment parameter?

    Also, which Ice version are you using?

    Cheers,
    Benoit.
  • benoit wrote: »
    If you don't have these files, it most likely indicates that your database environment is still private. How do you create the Freeze connection in your program? Are you correctly using "bt" for the database environment parameter?

    Also, which Ice version are you using?

    Cheers,
    Benoit.

    thanks very much.

    i've found the problem. when i created the Freeze connection i used "/opt/btsys" as the database environment parameter. but that should be "bt".

    such a stupid mistake :(


    thanks for your response
  • another quertion, why Freeze use DB_PRIVATE flag ?