beyanet.com wrote:
Brent,And how do you handle session closing? I observed that standart HibernateUtil from Hibernate example doesn't work well in servlets. In my opinion the only way out is using the servlet-filter described in wiki.
the way I use hibernate with flowscript is to simply call the method from flowscript and allow the java method to handle all transaction-session open and closing processes. I place no hibernate code in cocoon. All the hibernate code is self contained within the java method.
regards
Uzo
Jk, I use hibernate within JBoss 4 as follows:
InitialContext ctx = new InitialContext(); sessionfactory = (SessionFactory)ctx.lookup("java:/hibernate/SessionFactory"); session = sessionfactory.openSession(); transaction = session.beginTransaction(); orderSet = (Order)session.load(Order.class, orderNum); Hibernate.initialize(orderSet.getOrderItems()); transaction.commit(); session.close();
for example.
regards
Uzo
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]