Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Return id as meta data fix #83

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

l0st3d commented Mar 21, 2011

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.

Contributor

paraseba commented Mar 23, 2011

I have a similar problem in PostgreSQL. Not throwing an exception, but I always get {:last-index nil}

Contributor

l0st3d commented Mar 23, 2011

does this patch fix the problem?

Contributor

paraseba commented Mar 23, 2011

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

Contributor

l0st3d commented Mar 23, 2011

I'm afraid not - my PostgreSQL experience is pretty limited. I'd just be googling. Sorry.

Contributor

l0st3d commented Mar 24, 2011

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.

Contributor

paraseba commented Mar 24, 2011

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"]

Collaborator

bendlas commented Jul 29, 2011

This should be fixed by 257a5e0
Please let me know if it works for you.

@bendlas bendlas closed this Jul 29, 2011

Contributor

l0st3d commented Oct 5, 2011

this appears fixed. Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment