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

Fill method cause Dynamic SQL Error [DNET326] #337

Closed
firebird-automations opened this issue Jun 14, 2010 · 3 comments
Closed

Fill method cause Dynamic SQL Error [DNET326] #337

firebird-automations opened this issue Jun 14, 2010 · 3 comments

Comments

@firebird-automations
Copy link

Submitted by: Thomas (inva)

Hi, I'm trying to draw my problem.
It only occures when connection pooling is disabled.

1. Initialize my FbDataAdapter's once within an Init()

[QUOTE]// initialise DataAdapter
DA_MainView = new FbDataAdapter(Select_MainView);
DA_DetailView = new FbDataAdapter(Select_DetailView);
DA_Image = new FbDataAdapter(Select_Images);[/QUOTE]

2. Call every FbDataAdapter's Fill method within a method

[QUOTE]
using (connection = new FbConnection(sConnectionString))
{
try
{
connection.Open();

  // start a transaction
  usedTransaction = connection\.BeginTransaction\(\);

  // set the transaction & connection for the select statements of the data adapters
  DA\_MainView\.SelectCommand\.Connection = connection;
  DA\_MainView\.SelectCommand\.Transaction = usedTransaction;
  DA\_DetailView\.SelectCommand\.Connection = connection;
  DA\_DetailView\.SelectCommand\.Transaction = usedTransaction;
  DA\_Image\.SelectCommand\.Connection = connection;
  DA\_Image\.SelectCommand\.Transaction = usedTransaction;

DA_MainView.Fill(tblMainView);
DA_DetailView.Fill(tblDetailsView);
DA_Image.Fill(tblImage_FileIDs);
.
.
.[/QUOTE]

3. calling the method twice results in an SQL error. Executing DA_DetailView.Fill(tblDetailsView); the second time causes the error, while calling DA_MainView.Fill(tblMainView); still works.
But what makes me curious is that i got different error messages within the exception message property.

I got following error messages:
[QUOTE] "invalid request handle"[/QUOTE]
and
[QUOTE]
"Dynamic SQL Error
SQL error code = -502
Attempt to reopen an open cursor"[/QUOTE]

If connection pooling is turned on, no error occures.

Does anybody got an idea how to fix this? Or is this behaviour a bug of the firebird database?

@firebird-automations
Copy link
Author

Commented by: Thomas (inva)

In addition, stacktrace

"bei FB_965910463_Class.isc_dsql_execute2(IntPtr[] statusVector, Int32& trHandle, Int32& stmtHandle, Int16 da_version, IntPtr inXsqlda, IntPtr outXsqlda)
bei FB_965910463_Class.IFbClient.isc_dsql_execute2(IntPtr[] statusVector, Int32& trHandle, Int32& stmtHandle, Int16 da_version, IntPtr inXsqlda, IntPtr outXsqlda)\
bei FirebirdSql.Data.Client.Native.FesStatement.Execute()
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteDbDataReader(CommandBehavior behavior)
bei System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
bei System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
bei System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
bei System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
sg.DatabaseInterface.CDatabaseController.Query() in D:\\Projekte\\SG_Workstation\\DatabaseInterface\\CDatabaseInterface.cs:Zeile 494."

and a further error message:
("Attempted to read or write protected memory. This is often an indication that other memory is corrupt.")

@firebird-automations
Copy link
Author

Commented by: Thomas (inva)

DLL Version:
fbembed.dll: 2.1.3.18185
FirebirdSql.Data.FirebirdClient.dll: 2.5.2.0

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => 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