Closed l0st3d closed 12 years ago
I have a similar problem in PostgreSQL. Not throwing an exception, but I always get {:last-index nil}
does this patch fix the problem?
Unfortunately no. The problem is more complex in PostgreSQL since getGeneratedKeys is not supported for batch execution (http://postgresql.1045698.n5.nabble.com/PreparedStatement-batch-statement-impossible-td3406927.html). Any ideas on how to solve this problem?
UPDATE: with the patch applied an exception is thrown by PostgreSQL. So probably this patch isn't a good idea
I'm afraid not - my PostgreSQL experience is pretty limited. I'd just be googling. Sorry.
UPDATE: with the patch applied an exception is thrown by PostgreSQL. So probably this patch isn't a good idea
In that case, I'd suggest that the whole id as meta-data thing needs a little re-think.
That, or we need to move away from executeBatch. Apparently Oracle doesn't support getGeneratedKeys for batch either.
This problem disappeared for me after switching from [com.mysql/connectorj "5.1.12"] to [mysql/mysql-connector-java "5.1.6"]
This should be fixed by 257a5e02c998923a1457 Please let me know if it works for you.
this appears fixed. Many thanks
Mysql threw an SQLException when calling conj! with this message: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or Connection.prepareStatement().
So I did as it said.