Subject | Re: [firebird-support] Hibernate, alter table and single user |
---|---|
Author | Helen Borrie |
Post date | 2005-03-01T23:27:09Z |
At 09:30 PM 1/03/2005 +0000, you wrote:
off-line, preventing all users except sysdba or the database owner from
connecting. To understand how it works, you should read Ch. 39 of The
Firebird Book (if you have it); otherwise Google for OpGuide.pdf, download
it, and look up the details of gfix -shut. If you try to guess this one,
or to go by FAQ notes attached to some third party tool, you're fairly
unlikely to get it to work.
either sysdba or database owner, i.e. you have "exclusive access".
client could log in, and that client would have to be sysdba or owner.
Note the following:
1) You can alter database objects without having exclusive access, but you
will get "object in use" if any transaction is currently using the object.
You can keep trying if you want to.
2) You can not add or drop foreign key constraints UNLESS you have both
exclusive access AND no other transaction running.
I should probably write a How-to for getting exclusive access...
And you should probably start your Firebird career with the employee
database. From a design POV, it is disgusting; but at least it has data
in it and you can use it to get your head around transaction concurrency...
./heLen
>On the Hibernate site, they list as a known issue:No, you can "shut down" a database in the sense that you take the database
>
>"If you are altering tables you should be in single user mode. This
>can be achieved by running gfix -shut. It's also sufficient to have
>only one database connection open (eg. immediately after starting the
>application). If more than one connection is open, you will see
>errors like "table is in use". To restart your database use gfix -
>online."
>
>I looked at 'gfix -shut' and I think what they are saying is that you
>can shut down your database to see if there are other users using it?
off-line, preventing all users except sysdba or the database owner from
connecting. To understand how it works, you should read Ch. 39 of The
Firebird Book (if you have it); otherwise Google for OpGuide.pdf, download
it, and look up the details of gfix -shut. If you try to guess this one,
or to go by FAQ notes attached to some third party tool, you're fairly
unlikely to get it to work.
>But to address the problem itself, what does "you should be in singleIt means the database is shut down (off-line) and you are logged in as
>user mode" mean?
either sysdba or database owner, i.e. you have "exclusive access".
>The paragraph above makes sense if only the adminFor a multi-user system, yes, it will make it useless. One and only one
>is altering tables on rare occasions, but I originally started
>looking into this because the Hibernate *example code* makes 'alter
>table' calls and it's failing.
>
>And if do use Firebird in single user mode with Hibernate, does that
>make Hibernate less useful in any way?
client could log in, and that client would have to be sysdba or owner.
Note the following:
1) You can alter database objects without having exclusive access, but you
will get "object in use" if any transaction is currently using the object.
You can keep trying if you want to.
2) You can not add or drop foreign key constraints UNLESS you have both
exclusive access AND no other transaction running.
I should probably write a How-to for getting exclusive access...
And you should probably start your Firebird career with the employee
database. From a design POV, it is disgusting; but at least it has data
in it and you can use it to get your head around transaction concurrency...
./heLen