StatelessSession being cast to Session in AbstractEntityPersister (Hibernate)
问题 I'm trying to do a simple save on a StatelessSession. Can someone spot what I'm doing wrong to end up in the Hibernate method that tries to do an invalid cast of StatelessSession to Session. I would appreciate any feedback. My example code: StatelessSession statelessSession = getSessionFactory().openStatelessSession(); Transaction tx = statelessSession.beginTransaction(); Object ret = null; try { ret = statelessSession.insert(obj); tx.commit(); statelessSession.close(); } catch (Throwable t)