Web site optimization - APPENDIX C n HIBERNATE AND SPRING 309 n

APPENDIX C n HIBERNATE AND SPRING 309 n HIBERNATE AND SPRING 309 Listing C-17 Declaring the OpenSessionInViewInterceptor for Use in the Spring View
The interceptor needs to control the behavior of the session factory, so we must provide it with a reference to the appropriate bean. We can also dictate whether a single Session object will be used for the entire duration of the user request. Setting this to true is the most efficient approach, and therefore the default; however, it has potential side effects, particularly if declarative transactions are not in use. When set to false, individual sessions will be acquired for each DAO operation. The Sample Configuration File Listing C-18 shows the full Spring configuration file of our example application as a handy reference to what s required in creating a Hibernate-based Spring application. Listing C-18. The Complete Spring Configuration File


We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Leave a Reply