Re: [Firebird-net-provider] Firebird and Threads

2007-10-09 Thread Carlos
Hello:

 Is there a thread-safe way to access data using Firebird .Net?

ADO.NET Data Providers aren't thread-safe, you should be using a
connection per thread.

-- 
Carlos Guzmán Álvarez
Vigo-Spain

Blog: http://carlosga.wordpress.com/
FirebirdClient  : http://www.firebirdsql.org/
XMPP Client : http://code.google.com/p/xmppclient/
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Remote Connection Problem

2007-10-09 Thread Carlos
Hello:

 I am using the .Net 2.0 provider in RAD Studio 2007.  I am able to connect
 to a local database but when I try to enter the remote IP in the Data Source
 field and the path to the DB in the database field, I get a message Unable
 to complete network request to host xx.xx.xx.xx

 I am connected to the remote machine via VPN.  Anyone have any ideas

Are you sure there is nothing blocking connections against the server
?? ( like a firewall )

-- 
Carlos Guzmán Álvarez
Vigo-Spain

Blog: http://carlosga.wordpress.com/
FirebirdClient  : http://www.firebirdsql.org/
XMPP Client : http://code.google.com/p/xmppclient/
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Remote Connection Problem

2007-10-09 Thread Jiri Cincura
On 10/8/07, Phillip Day [EMAIL PROTECTED] wrote:
 I am using the .Net 2.0 provider in RAD Studio 2007.  I am able to connect
 to a local database but when I try to enter the remote IP in the Data Source
 field and the path to the DB in the database field, I get a message Unable
 to complete network request to host xx.xx.xx.xx

ISQL works?

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Remote Connection Problem

2007-10-09 Thread Phillip M. Day
Yes, sure does.

Phillip
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Jiri Cincura
Sent: Tuesday, October 09, 2007 2:48 AM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Remote Connection Problem

On 10/8/07, Phillip Day [EMAIL PROTECTED] wrote:
 I am using the .Net 2.0 provider in RAD Studio 2007.  I am able to
connect
 to a local database but when I try to enter the remote IP in the Data
Source
 field and the path to the DB in the database field, I get a message
Unable
 to complete network request to host xx.xx.xx.xx

ISQL works?

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Firebird and Threads

2007-10-09 Thread Peter Gissel
Dean Harding [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Peter Gissel wrote:
 I am using the Firebird .Net driver for database io in Visual Studio 2005
 .Net 2.0 C#. I have three different threads accessing data. I keep 
 getting
 Dynamic SQL Error Exceptions. The error is fairly random but usually
 involves an odd character out of place for a field or table name, 
 resulting
 in an error. I have tried using a separate connections for each thread, 
 and
 I have tried putting all database IO inside Monitor.Enter()/Monitor.Exit
 blocks, but the error still occurs. If I put all my code into one thread 
 and
 run things sequentially the errors go away. I get these errors using a
 server or embedded. As far as I can tell, this type of access should be 
 safe
 as long as I use a unique connection in each thread. I have tried the 
 some
 thing with SQL Server 2005 but could not duplicate the error.

 Is there a thread-safe way to access data using Firebird .Net?

 Each connection can only have one command executing at once, but you
 should be using connection pooling anyway (i.e. open connection; execute
 command; close connection) so that shouldn't ever be a problem.

 What is the code you're using to generate the commands? and when you get
 the error, what does the statement look like?

 Dean.


Here is the code. Each thread has it's own connection and reuses it. I put 
together a simple app that reproduces it. Essentially the following code is 
executed in each of three different threads, all doing a different query on 
it's own connection.

FbDataAdapter adapter = new FbDataAdapter(Select * from FilePath where id  
0, m_connection3);

DataSet tracks = new DataSet();

adapter.Fill(tracks, FilePath);

Here is a sample error:

Dynamic SQL Error
SQL error code = -204
Table unknown
ILEPATH
At line 1, column 24



The table name is FilePath.





-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


[Firebird-net-provider] Connection Pooling

2007-10-09 Thread Phillip Day
I am fairly new to .Net and would like to understand a best practice of 
using Firebird in my .Net project.

I have a web application that we are converting from CGI to .NET.  The CGI 
application establishes a connection for every request.  When architecting 
the .Net application, would the best approach be to create a connection for 
every session and assign the resulting connection as an object of the 
session, or is there a better approach.

We are using RAD Studio 2007 and currently I have the connection object 
created in the Global.asax unit of our project in the Session_Start event. 
Subsequently, the connection is closed and resources are released in the 
Session_End event.  Code in Session_Start below:


dbReactorNet := FirebirdSql.Data.FirebirdClient.FbConnection.Create;

dbReactorNet.ConnectionString := 
'User=SYSDBA;Password=masterkey;Database=c:\dev\reactornet\db\reactornet.fdb;DataSource=Localhost;Port=3050;Dialect=1;Charset=NONE;Role=;Connection
 
lifetime=0;Connection timeout=15;Pooling=True;Packet Size=8192;Server 
Type=0';

dbReactorNet.Open;
Session['DBConnection'] := dbReactorNet;
--




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Jiri Cincura
Why not to create connection(s) where you need and use connection
pool? IMO saving object to the session is a really bad idea.

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Phillip M. Day
I guess that is what I am asking.  How do I use a connection pool?

Phillip

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Jiri Cincura
Sent: Tuesday, October 09, 2007 12:45 PM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Connection Pooling

Why not to create connection(s) where you need and use connection
pool? IMO saving object to the session is a really bad idea.

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Jiri Cincura
On 10/9/07, Phillip M. Day [EMAIL PROTECTED] wrote:
 I guess that is what I am asking.  How do I use a connection pool?

You already has Pooling=true in connection string. So just
open/close connections where you need. Try to open at least as
possible and close as fast as possbile. Provider will the use only
this one (or little bit more in some concurrent situations) connection
with no performance problems.

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Phillip M. Day
Do you mind pointing me towards a sample project or code that I can
reference? 

Thanks in advance.

Phillip

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Jiri Cincura
Sent: Tuesday, October 09, 2007 1:23 PM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Connection Pooling

On 10/9/07, Phillip M. Day [EMAIL PROTECTED] wrote:
 I guess that is what I am asking.  How do I use a connection pool?

You already has Pooling=true in connection string. So just
open/close connections where you need. Try to open at least as
possible and close as fast as possbile. Provider will the use only
this one (or little bit more in some concurrent situations) connection
with no performance problems.

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Jiri Cincura
On 10/9/07, Phillip M. Day [EMAIL PROTECTED] wrote:
 Do you mind pointing me towards a sample project or code that I can
 reference?

Try to run one and more instances and see how many connections you see
in DB when pooling is true and when false.

class Program
{
static void Main(string[] args)
{
Test1();
Console.ReadKey();
}

private static void Test1()
{
using (FbConnection conn = new FbConnection(@data
source=localhost;initial catalog=ucime;user
id=SYSDBA;password=masterkey;pooling=true))
{
conn.Open();
Console.WriteLine(Connection opened ...);
Console.ReadKey();
//conn.Close();
}
Console.WriteLine(Connection closed...);
}
}

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Phillip M. Day
So, if I understand this correctly..

For each request that my .Net application processes, I should create a
new FBConnection object with the connection string I am currently using.
My current code only creates the FBConnection for each session.

Phillip

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Jiri Cincura
Sent: Tuesday, October 09, 2007 2:38 PM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Connection Pooling

On 10/9/07, Phillip M. Day [EMAIL PROTECTED] wrote:
 Do you mind pointing me towards a sample project or code that I can
 reference?

Try to run one and more instances and see how many connections you see
in DB when pooling is true and when false.

class Program
{
static void Main(string[] args)
{
Test1();
Console.ReadKey();
}

private static void Test1()
{
using (FbConnection conn = new FbConnection(@data
source=localhost;initial catalog=ucime;user
id=SYSDBA;password=masterkey;pooling=true))
{
conn.Open();
Console.WriteLine(Connection opened ...);
Console.ReadKey();
//conn.Close();
}
Console.WriteLine(Connection closed...);
}
}

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Jiri Cincura
On 10/9/07, Phillip M. Day [EMAIL PROTECTED] wrote:
 So, if I understand this correctly..

 For each request that my .Net application processes, I should create a
 new FBConnection object with the connection string I am currently using.
 My current code only creates the FBConnection for each session.

Not only process. You can create (and dispose) FbConnection object in
every method. There's no problem with it. That's why the connection
pool is there.

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Connection Pooling

2007-10-09 Thread Phillip M. Day
Thank you very much for your help.

Phillip

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Jiri Cincura
Sent: Tuesday, October 09, 2007 5:52 PM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Connection Pooling

On 10/9/07, Phillip M. Day [EMAIL PROTECTED] wrote:
 So, if I understand this correctly..

 For each request that my .Net application processes, I should create a
 new FBConnection object with the connection string I am currently
using.
 My current code only creates the FBConnection for each session.

Not only process. You can create (and dispose) FbConnection object in
every method. There's no problem with it. That's why the connection
pool is there.

-- 
Jiri {x2} Cincura (Microsoft Student Partner)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider