|
From: Michael H. <mg...@gm...> - 2009-05-31 16:56:08
|
On 31.05.2009 14:23 Andreas Maier wrote:
> I remeber, i had the same exception. I reinstalled my firebird (FB 2.1)
> and all worked fine.
> I didn't investigate more.
> Maybe the client-dll differs from firebird-version. (Only a thought)
No, I've only the one Firebird version installed, and I made sure that
IBPP loads the correct fbclient.dll for it.
I used this test program:
//---------------------------------------------------------------------
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include "ibpp.h"
int _tmain(int, _TCHAR*)
{
try
{
IBPP::Database db = IBPP::DatabaseFactory("localhost",
"D:\\Arbeit\\foo.fdb", "SYSDBA", "masterkey", "",
"ISO8859_1", "");
IBPP::Transaction tr = IBPP::TransactionFactory(db);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
db->Connect();
tr->Start();
st->Execute("SELECT * FROM TBL_TEST");
st->Fetch();
int f1;
st->Get(1, f1);
IBPP::Blob b = IBPP::BlobFactory(db, tr);
st->Get(2, b);
b->Open();
char c[1024];
int br = b->Read(&c, 1024);
b->Close();
IBPP::Blob b2 = IBPP::BlobFactory(db, tr);
b2->Create();
b2->Write(&c, br);
b2->Close();
st->Prepare("UPDATE TBL_TEST SET TEST = ?");
st->Set(1, b2);
st->Execute();
b->Open();
br = b->Read(&c, 1024);
b->Close();
b2->Open();
br = b2->Read(&c, 1024);
b2->Close();
tr->Commit();
}
catch (std::exception& e)
{
std::cout << e.what();
}
return 0;
}
//---------------------------------------------------------------------
What this does is (in a single transaction) read a blob value, write it
back, read it back using the first (no longer valid blob id), finally
read it back using the blob id that was used for writing. The last
operation is the one that consistently fails.
I don't know why this doesn't work, but I think FlameRobin should be
fixed to not fail in the same way. There is no reason to read the blob
back, anyway, it has just been written to the database.
Any comments and insights welcome.
--
Michael Hieke
|