-
Notifications
You must be signed in to change notification settings - Fork 34
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
FBblob::EIO_After_Read - invalid BLOB handle #80
Comments
probably you have not started transaaction in connection,
|
You are right @xdenser, I confused one of the particularities of the lib where a new transaction is only created upon call to Now I updated to code to ensure that a
|
Still getting error ? this is trange
|
@xdenser Thanks for the tip. I hadn't noticed the blob test in the tests folder.
I noticed that con.prepareSync() must be called before creating the FBblob, so it will start the required transaction. But If I don't use the stream approach and if I try to write to the FBblob as show below ( return new Promise((resolve, reject) => {
FirebirdManager.pool.get()
.then((tx) => {
let ff = tx.prepareSync('update table set logo = ?');
let d = tx.newBlobSync();
let dataBuffer = fs.readFileSync(filePath);
d._writeSync(dataBuffer);
save();
// or in async
// d._write(dataBuffer, function(err){
// if (err){
// return rollback();
// }
// save();
// });
function save(){
try {
ff.execSync(d);
tx.commitSync();
tx.disconnect();
resolve();
} catch (e){
rollback(e); //<-------- In FBStatement::execSync - invalid BLOB ID
}
}
function rollback(e){
tx.rollbackSync();
tx.disconnect();
reject(e);
}
})
.catch(err => reject(err));
}); By the way, I forked the project and I did run all the tests.
|
I'm trying to push a blob to my database but until now I couldn't figure out what's going wrong.
For example:
Having an open connection named tx.
Both Return the exactly same error.
FBblob::EIO_After_Read - invalid BLOB handle
Using _writeSync
The text was updated successfully, but these errors were encountered: