Of course :-), but I keep getting the below exceptions. In essence, I do the following:
1. Employee e = new Employee();
2. TreeSet ts = new TreeSet();
3. ts.add(new Office())...blabala ad infinitum.
4. e.setOffices(ts);
5. session.save(e);
6. Obtain an office iterator from e and for each item do a session.save(office);
I use MySQL and autoincrement and "native" id. After 5, I print the id, and indeed, there is a new object id, but then the below happens...
004-04-26 01:07:06,566 ERROR http8080-Processor22 net.sf.hibernate.JDBCException: Could not execute JDBC batch update
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:129)
Caused by: java.sql.BatchUpdateException: Deadlock found when trying to get lock; Try restarting transaction, message from server: "Lock wait timeout exceeded; Try restarting transaction"
michael wrote:
Of course it is.