Discussion:
jdbc.commit() does not push data to database - no errors
(too old to reply)
Markus Rentsch
2021-04-07 16:55:25 UTC
Permalink
Hi

I have an add (passiv mode) jdbc connector to postgres named conFilesPostgres.
It is called from a lookup connector to Notes with conFilesPostgres.add(newEntry).
I have coded the 'override add' hook as follows

var jdbc = conFilesPostgres.connector;
jdbc.setCommitMode("Manual");
.... doing the upload of the file
.... building the insert prepared statement pw
var temp = ps.executeUpdate();
jdbc.commit;

There are no errors. But the transaction is not commited - i.e. no file uploaded and no record is inserted in the table.
When I change the commit mode of the connector to "After every database operation" (and remove the jdbc.setCommitMode("Manual")) then the file is uploaded and a new record is created.
I don't know, why the jdbc.commit is not pushing the changes through to the postgres db.
I use the same construct in another jdbc iterator postgres connector in the 'epilog before close' hook where it just works fine.

Any ideas what i have to change to get the manual commit to work?

As always, very appreciative of your comments and all your posts here in this google group!
Markus
Eddie Hartman
2021-04-08 11:53:45 UTC
Permalink
Could it be something a simple as forgetting the parenthesis when calling the commit() function?

jdbc.commit();

Been there, done that :)

/Eddie
Post by Markus Rentsch
Hi
I have an add (passiv mode) jdbc connector to postgres named conFilesPostgres.
It is called from a lookup connector to Notes with conFilesPostgres.add(newEntry).
I have coded the 'override add' hook as follows
var jdbc = conFilesPostgres.connector;
jdbc.setCommitMode("Manual");
.... doing the upload of the file
.... building the insert prepared statement pw
var temp = ps.executeUpdate();
jdbc.commit;
There are no errors. But the transaction is not commited - i.e. no file uploaded and no record is inserted in the table.
When I change the commit mode of the connector to "After every database operation" (and remove the jdbc.setCommitMode("Manual")) then the file is uploaded and a new record is created.
I don't know, why the jdbc.commit is not pushing the changes through to the postgres db.
I use the same construct in another jdbc iterator postgres connector in the 'epilog before close' hook where it just works fine.
Any ideas what i have to change to get the manual commit to work?
As always, very appreciative of your comments and all your posts here in this google group!
Markus
Loading...