You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. We have some table TABLE1 contains one column ID (int)
2. Open 2 connections in different threads
3. Connection 1 - select some data from TABLE1, then close
4. Connection 2 - changes structure of TABLE1 adding column COL_1 (any type)
5. Connection 1 (open new)
6. Connection 2 - close
7. Connection 1 - insert data in TABLE1, gets error
Here is sample Code for console application:
using System;
using System.Collections.Generic;
using System.Text;
using FirebirdSql.Data.FirebirdClient;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static FbConnectionStringBuilder fbcs;
static FbConnection cn1;
static FbConnection cn2;
static ManualResetEvent e1 = new ManualResetEvent(false);
static ManualResetEvent e2 = new ManualResetEvent(false);
static ManualResetEvent e3 = new ManualResetEvent(false);
This is expected behavior of SuperClassic/Classic architecture. Your code has connection pooling turned on, so the step "5. Connection 1 (open new)" will actually give you the same connection as used in "3. Connection 1" and this one was active before the alter happened. The metadata is in these architectures cached for connection and hence it fails.
After DDL changes you should close and open all other connections (or simply restart Firebird server) so the metadata are fresh.
Submitted by: Anton Kononov (stgolem)
Votes: 2
1. We have some table TABLE1 contains one column ID (int)
2. Open 2 connections in different threads
3. Connection 1 - select some data from TABLE1, then close
4. Connection 2 - changes structure of TABLE1 adding column COL_1 (any type)
5. Connection 1 (open new)
6. Connection 2 - close
7. Connection 1 - insert data in TABLE1, gets error
Here is sample Code for console application:
using System;
using System.Collections.Generic;
using System.Text;
using FirebirdSql.Data.FirebirdClient;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static FbConnectionStringBuilder fbcs;
static FbConnection cn1;
static FbConnection cn2;
static ManualResetEvent e1 = new ManualResetEvent(false);
static ManualResetEvent e2 = new ManualResetEvent(false);
static ManualResetEvent e3 = new ManualResetEvent(false);
}
The text was updated successfully, but these errors were encountered: