hi i am using GORM and i have an user table in database. also I have an update method that updates a users profile. when i am trying to update a contact its ok with first try, but after second or sometimes third try, iam getting
ERROR org.hibernate.transaction.JDBCTransaction - Could not toggle autocommit
java.sql.SQLException: Error during query: Unexpected Exception: java.lang.ArrayIndexOutOfBoundsException message given: 3
exception when i am trying to do this:
User updateUser(User tempUser){
def id=tempUser.id
User user = User.get(id)//this line throws exception
First of all, there is not enough information.
Why are you doing it like this? Is this code in a Domain class?
You can update User instance classic way in your controller:
Also you can try to add method to user instance (in User domain class), smth like this:
and then invoke it in your controller:
I didn’t test code snippets above, so be carefull. And about your code, it would be nice, if you gave some more code: parts of User class, more of updateUser method.
Regards.