Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpretation of CommandBehavior.CloseConnection [DNET149] #159

Closed
firebird-automations opened this issue Jan 3, 2008 · 5 comments
Closed

Comments

@firebird-automations
Copy link

Submitted by: Chris Wilson (cwilson)

When opening a datareader with CloseConnection setting, get an error message (something about the cursor) when try to read first record.

Workaround: don't use that setting and make sure the dr is manually closed.

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Can you provide a testcase?

This code works fine for me (2.1.0, FB 2.0):
using (FbConnection conn = new FbConnection(@"data source=localhost;initial catalog=ucime;user id=SYSDBA;password=masterkey"))
{
conn.Open();
using (FbCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "select * from rdb$database";
using (FbDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
while (dr.Read())
{
Console.WriteLine(dr[0]);
}
}
}
}

@firebird-automations
Copy link
Author

Modified by: @cincuranet

assignee: Carlos Guzman Alvarez [ carlosga_fb ] => Jiri Cincura [ cincura_net ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Commented by: Chris Wilson (cwilson)

It appears to be a false alarm. Yesterday, I was getting messages from Firebird (didn't write it down) that said message text not found but had the work "Cursor" in it. I *thought* I just removed the CloseConnection flag and it started to work OK. However, when I add that back in now, no error occurs.

I'd file this one away; if I can reproduce, I'll post again.

Sorry.

Chris

P.S. Keep up the good work!

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants