On Wednesday 29 April 2009 11:14:08 am Doug Pham wrote:
> Wes,
>      When will the book be ready?  About a year ago, I tried the basic S2,
> Spring & Hibernate and I have the hardest of time to do things as the
> connection keep getting closed before I could update things.  Hopefully,
> your book will help me understand why that was.  I have been using S2,
> Hibernate & Sitemesh which is doing OK for me.  Hopefully, you have some
> unit testing setup and strategy as that is my main weakness.
>

I've been ramping back up working on the book, so if you are in the 
publisher's early access program, you should start seeing new chapters soon. 

When you say Hibernate, are you using it as a JPA provider? I'd have to look, 
but I think I am using Hibernate in the book as the JPA provider (it's either 
Hibernate or OpenJPA). Are you currently using Spring? I can't really tell if 
you are saying that you are or aren't. If so, make sure you add the 
OpenEntityManagerInView filter (I think that's what it is called). The example 
app I have up on the google code site for the book has a set of spring configs 
that should work, although I don't know if it is the one I use with pooling. 
Let me know and I can post one that uses commons-dbcp for connection pooling. 
If you aren't using Spring there is an opensessioninview interceptor (or is it 
a filter?) in the struts wiki somewhere. Although Hibernate's session and 
JPA's EntityManager aren't exactly identical, the need for something to keep 
the session/entitymanager open while the view is rendering remains. 

Anyhow, I will have a section on unit testing in the book. I plan to cover 
basics of JUnit, but to give more details on the mock classes and helper 
classes like StrutsTestCase that can be helpful if you need the dispatcher 
initialized. 

-Wes

-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to