Re: [firebird-support] Object in use... wtf???

2013-11-26 Thread Ann Harrison
On Tue, Nov 26, 2013 at 8:03 AM, Kjell Rilbe  wrote:

>
>  Scenario, in a single connection I do this:
>
> 1. Start transaction.
> 2. Create table.
> 3. Commit.
> 4. Start transaction.
> 5. Insert rows.
> 6. Select using join with other tables.
> 7. Commit.
> 8. Start transaction.
> 9. Drop table.
>  ---> ERROR: Object is in use.
>
>
> Tried to add rd.Close after the for loop, but it didn't help. What did
> help was to close the connection and reopen it between the select commit
> and the starting the transaction for the drop.
>
> But why is that necessary?
>
>
I know nothing about .Net or its options.  The underlying problem is that
prepared statements are associated with a connection, not a transaction.
 That means that when you reuse a statement, Firebird doesn't have to
parse, compile, and optimize it.  To prevent unfortunate accidents.
Firebird won't drop tables that are referenced in saved statements.
Someone in the .Net area should be able to figure out how to close
statement handles so you can drop tables that only your connection has used.

Good luck,


Ann


Re: [firebird-support] Re: Object in use... wtf???

2013-11-26 Thread Kjell Rilbe













[firebird-support] Re: Object in use... wtf???

2013-11-26 Thread Dmitry Yemanov
26.11.2013 17:03, Kjell Rilbe wrote:
>
>> Anything wrong with these options etc?
>
> Tried to add rd.Close after the for loop, but it didn't help. What did
> help was to close the connection and reopen it between the select commit
> and the starting the transaction for the drop.
>
> But why is that necessary?

Wouldn't it be more useful to ask that in .net provider newsgroup instead?


Dmitry






++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com 

++
Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
http://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] One query either of the two WHERE clause

2013-11-26 Thread Venus Software Operations













Re: [firebird-support] Object in use... wtf???

2013-11-26 Thread Kjell Rilbe













[firebird-support] Re: pyfirebirdsql connection with role

2013-11-26 Thread Philippe Makowski
Le 26/11/2013 07:37, ggoo...@yahoo.com a écrit :

>   I am trying to access a firebird 1.5.3 database remotely from python using 
> pyfirebirdsql. (access from Ubuntu precise 64 bit to Firebird running on 
> Windows)
>
>   I can connect to the database locally using a username/password with a 
> defined role (using FlameRobin) but the connection string for pyfirebirdsql 
> doesn’t seem to allow a role to be defined so that I can use this same 
> username. Have I missed something?
>
something like :
firebirdsql.connect(dsn='host:/path/database.db', user='limited_user',
password='pass', role='MORE_POWERFUL_ROLE')

should work

but it seems that the code don't use role :
https://github.com/nakagami/pyfirebirdsql/blob/master/firebirdsql/fbcore.py

you should report it here https://github.com/nakagami/pyfirebirdsql or 
better propose a patch


>   I have tried to install KinterbaseDB but it needs Firebird client installed 
> and I couldn’t get all the relevant dependencies for Firebird 1.5 to install 
> properly on my Ubuntu system so gave up on that option.
>
KInterbasDB is obsolete
use fdb
https://pypi.python.org/pypi/fdb/

>   If I only want read access will fdb work or is there some other option I 
> have missed?
fdb need firebird client
but it will work







Re: [firebird-support] One query either of the two WHERE clause

2013-11-26 Thread Venus Software Operations













[firebird-support] RE: what should i think of when creating a shared server with firebird?

2013-11-26 Thread mariuz
Also you might use LXC for isolating database servers for each client 
 

 http://linuxcontainers.org/ http://linuxcontainers.org/

 it's used on heroku to isolate dynos 
 http://www.royans.net/arch/heroku-platform-for-scalable-applications/ 
http://www.royans.net/arch/heroku-platform-for-scalable-applications/

 Another alternative is docker 
 http://www.docker.io/gettingstarted/ http://www.docker.io/gettingstarted/

 

---In firebird-support@yahoogroups.com,  wrote:

 it's time we start creating servers for firebird. i thinking of shared 
servers, like they do on mysql on almost all shared server around the world.
i am thinking of selling shared server accounts with firebird. 

 what do i have to think of and what do i need to be successful?
 

 simple question.
 and i need simple answers.
 





Re: [firebird-support] Object in use... wtf???

2013-11-26 Thread Nagy Szilveszter
I think this is a bug in FB 2.5, which causes a lot of headaches for me 
too...Sometimes even restarting Firebird service doesn't help. 
Does anyone know a solution for this? I'm using FB 2.5 64 bit Superserver on 
Centos Linux



On Tuesday, November 26, 2013 11:16 AM, Kjell Rilbe  
wrote:
 
  
Den 2013-11-25 23:50 skrev Alan McDonald såhär:

  
>
>Scenario, in a single connection I do this:
>
>1. Start transaction.
>2. Create table.
>3. Commit.
>4. Start transaction.
>5. Insert rows.
>6. Select using join with other tables.
>7. Commit.
>8. Start transaction.
>9. Drop table.
> ---> ERROR: Object is in use.
>
>I KNOW the table has been accessed only using this
  connection and the
>transactions listed above. So why is it in use at step 9
  and how can I avoid
>it?
>
>I need this to temporarily store some data to select data
  for a report, and
>the required set of columns in the temp table varies, so I
  cannot use a GTT
>since it has persistent DDL. Is there any other way to
  achieve that, i.e. a
>local temporary table? For pref I would like to have it
  local to the
>insert/select transaction...
>
>Waiting a while before step 8-9 (and subsequent commit) is
  not an option
>because this is done in application code that runs all the
  way while the
>user is waiting for the report to pop up - I do need to
  drop it right away.
>(Unless I would always just leave it there and instead
  drop it before step 1
>next time I run this kind of report, but it would annoy me
  to have a useless
>temp table lying around.)
>
>Thanks,
>Kjell
>
>What sort of transaction are you using? The select may be
  retaining.. Do you
>close the query?
>
Thank you! Umm... I did find it difficult to determine (docs?) what
the various transaction options in the .Net provider really mean for
FB, but these are the flags I use for all transactions:

FbTransactionBehavior.ReadCommitted
FbTransactionBehavior.RecVersion
FbTransactionBehavior.Wait

The select is done using this C# construct, which should close and
dispose of the query:

using (FbDataReader rd = 
cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
{
    rd.Read();
    for (int colnum = 0; colnum < rd.FieldCount; colnum++)
    {
    string colname = rd.GetName(colnum);
    int count = rd.GetInt32(colnum);
    if (count > 0)
        result.Counts[colname] = count;
    }
}

The FbCommand cmd has default settings except this:

cmd.CommandType = System.Data.CommandType.Text;

Anything wrong with these options etc?

Regards,
Kjell

-- 
--
Kjell Rilbe
DataDIA AB
E-post: kj...@datadia.se Telefon: 08-761 06 55
Mobil: 0733-44 24 64 


[firebird-support] pyfirebirdsql connection with role

2013-11-26 Thread ggoozee
Hi,
  
 I am trying to access a firebird 1.5.3 database remotely from python using 
pyfirebirdsql. (access from Ubuntu precise 64 bit to Firebird running on 
Windows)
  
 I can connect to the database locally using a username/password with a defined 
role (using FlameRobin) but the connection string for pyfirebirdsql doesn’t 
seem to allow a role to be defined so that I can use this same username. Have I 
missed something?
  
 I have tried to install KinterbaseDB but it needs Firebird client installed 
and I couldn’t get all the relevant dependencies for Firebird 1.5 to install 
properly on my Ubuntu system so gave up on that option.
  
 If I only want read access will fdb work or is there some other option I have 
missed?
  
 Thanks,
 Gary


Re: [firebird-support] Re: Object in use... wtf???

2013-11-26 Thread Kjell Rilbe













Re: [firebird-support] Object in use... wtf???

2013-11-26 Thread Kjell Rilbe













[firebird-support] Re: Object in use... wtf???

2013-11-26 Thread Dmitry Yemanov
26.11.2013 01:54, Kjell Rilbe wrote:
>
> Scenario, in a single connection I do this:
>
> 1. Start transaction.
> 2. Create table.
> 3. Commit.
> 4. Start transaction.
> 5. Insert rows.
> 6. Select using join with other tables.

Handles for both INSERT and SELECT statements must be destroyed.

> 7. Commit.
> 8. Start transaction.
> 9. Drop table.
>   ---> ERROR: Object is in use.

For the safety sake, ensure that your DDL transaction has the WAIT 
option set (or explicit timeout is specified).


Dmitry