SEVERE: Attempt to modify an identity column 'UID'
===

I am using hibernate. and i want to add a new row to table in my database persistently.

I am using the code in my action class is :

    try {
                Session session = HibernateUtil.getSessionFactory().getCurrentSession();
                session.beginTransaction();
                u = new Users();
                u.setAge(this.getAge());
                u.setCity(this.getCity());
                u.setEmail(this.getEmail());
                u.setName(this.getUsername());
                u.setPassword(this.getPassword());
                u.setSex(this.getSex());
                try {
                session.save(u);
                } 
                catch (Exception e) {
                this.addActionError("Oops. An Error Encountered...! Email address already registered. Try with your new email address.");
                return ERROR;
                }
                session.getTransaction().commit();
                session.close();
            } catch (Exception e) {
                this.addActionError("Oops. An Error Encountered...!");
                return ERROR;
            }






The page shows error sometimes of outer catch and sometimes of inner catch.
The glassfish server logs is :



    WARNING: SQL Error: -1, SQLState: 42Z23
    SEVERE: Attempt to modify an identity column 'UID'. 
    SEVERE: Could not synchronize database state with session
    org.hibernate.exception.SQLGrammarException: could not insert: [beans.Users]
    ..
    Caused by: java.sql.SQLSyntaxErrorException: Attempt to modify an identity column 'UID'. 

My table is 'Users' having primary key 'UID' which is auto-generated increment by 1. There are also many fields other than the above retrieved with getters but these are given default value as the table property with creation of row, so i decided not to apply getters and setter for them. also i didn't used getter and setter for 'uid' as it is auto generated.

Can someone point out what can be the error...?
thanks in advance.