Thanks! It seems that the generated key cannot be used without commiting a transaction first? I'm trying to insert a record then get the generated key and then update the record. But the record it seems is not being saved. I could make two different transactions and commit each but that would only rollback 1 transaction.