org.hibernate.HibernateException: identifier of an instance of org.cometd.hibernate.User altered from 12 to 3
in fact, my user table
user
Problem can be also in different types of object's PK ("User" in your case) and type you ask hibernate to get session.get(type, id);.
session.get(type, id);
In my case error was identifier of an instance of was altered from 16 to 32. Object's PK type was Integer, hibernate was asked for Long type.
identifier of an instance of was altered from 16 to 32
Integer
Long