Subject Re: [firebird-php] pconnect & disconnect & FK
Author Jochem Maas
michal.720 wrote:
> I built web application, which uses ibase_pconnect(). When I'm using
> this webapplication and I want to modify (using ibWebAdmin or ibExpert)
> my database, it's not possible.

which is logical and correct. you must have exclusive access to the
DB in order to change it's structure.

ibExpert has a handy 'Database Shutdown' tool which usually does it for me...
I use the 'pro' version (the one that costs money)

>
> The only solution I know is restart Apache (or Firebird or whole system ;-))
>
> When I restart Apache, it closes all connections and I'm able to modify
> my database including tables with foreign keys.
>
> But I can restart Apache2 only on my local computer (WinXP) or server,
> which I can manage (with necessary privileges/rights). And unfortunately
> on all (linux/unix) servers where my webapplications runs are not
> managed by me. I have no root access there.
>
> Does anybody know, how to
> - close connection created by ibase_pconnect() from PHP or Firebird
> (without any restart of Apache or Firebird)
> - unblock tables with foreign keys being accessed by ibase_pconnect to
> modified them
> - or any solution to solve this problem

ok, this is a little guess work:

have a switch in your app that allows you to go between pconnect and connect.
when you need to change the DB start using connect - existing pconnect links
will die out after a given period of time (at which point you can make the
changes) because the pconnect link is bound to a specific apache child process
and each child process is designed to run for only a specific number of requests
after which is dies.

maybe that technique will work for you - interested to know if it does or not.


>
> Thanks
> Michal
>
> (it's not a problem of ibWebAdmin although I use it)
>
> Lester Caine wrote:
>
>>michal.720 wrote:
>>
>>
>>
>>>Hello,
>>>I made a persistent connection to Firebird 1.5 server via PHP
>>>ibase_pconnect() function.
>>>
>>>At this time I need to create table in my database, which has relations
>>>to some existing tables with foreign keys.
>>>
>>>I cannot create this table because the table has relations to other
>>>tables and the (persistent) connection is still alive.
>>>
>>>Thanks for any advice,
>>>Michal
>>>
>>>(I'm using ibWebAdmin.)
>>
>>
>>I find that from time to time I need to hit 'Restart' on Apache2 simply
>>to clear the connections and carry out some other steps. But I think you
>>are possibly seeing a problem because ibWebAdmin already has a link to
>>the database and is using another to create the new table?
>>I tend to do this sort of work from IBOConsole, so I have not checked it
>>out just using ibWebAdmin - and that is when I need the 'Restart' even
>>when ibWebAdmin is not in use ;)
>>
>>Anybody fill in some more detail ?
>>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>