well among my issues now is that i'm realizing conceptually, what i'm doing won't work long term. Basically, I have this method that will insert a collection of objects into the database
public void persistAsAGroup(List<Evaluation> evals) {
StatelessSession session = sf.openStatelessSession();
for(Evaluation evaluation : evals) {
logger.info("inserting an eval");
session.insert(evaluation);
}
session.close();
}
Part of my issue with this ended up being a discrepancy between the size of the objects in here and hibernate.jdbc.batch_size. When they got to the same size, everything worked fine. I wonder though, should the same code above work correctly if I'm using EntityManager instead of StatelessSession? Why does it generate a new database connection on each insert?