SQLContainer - PostgreSQL - Returning autogenerated keys is not supported

Hello.

I am testing SQLContainer and everything seems to work but I cannot create new items using PostgreSQL as the DB.

My code:

[font=Courier New]

316 Object tempItemId = itemSQLContainer.addItem();
317 System.err.println("Got the new item id: " + tempItemId);
318 final Item tempItem = itemSQLContainer.getItem(tempItemId);
319 System.err.println("Got the new item: " + tempItem);
320 itemSQLContainer.commit();
321 System.err.println(“committed”);

[/font]

This generates the following output:

[font=Courier New]

19:36:56,605 ERROR [STDERR]
Got the new item id: Temporary row id
19:36:56,605 ERROR [STDERR]
Got the new item: ID:Temporary row id|created_at:null|created_by:null|modified_at:…
19:36:56,605 ERROR [STDERR]
Commiting changes through delegate…
19:36:56,605 INFO [STDOUT]
DB → begin transaction
19:36:56,607 INFO [STDOUT]
DB → rollback
19:36:56,607 ERROR [STDERR]
org.postgresql.util.PSQLException: Returning autogenerated keys is not supported.

19:36:56,607 ERROR [STDERR]
at ui.AbstractTabularView$3.buttonClick(AbstractTabularView.java:320)

[/font]

Is this a known limitation or am I doing something wrong?

How can I make it work?

I don’t know the exact implementation of SQLContainer but I do know that PostgreSQL works, just like Oracle does, with sequences as autonumber field. So may be you have to give this to the container??

Ok. I found the problem. I used a PostgreSQL JDBC driver which was too old.

Anything above version 8.2 is fine (I now use postgresql-8.2-507.jdbc4.jar).