Results 1 to 2 of 2

Thread: OpenSessionInViewFilter and multiple sessionfactories?

  1. #1
    Join Date
    Jan 2006
    Location
    Oslo, Norway
    Posts
    13

    Default OpenSessionInViewFilter and multiple sessionfactories?

    Hi

    My application has to acces two databases (one of them for read operations only). I want to use two sessionfactories for this with different database schemas specified in the hibernate.default_schema property.

    I am using struts, spring and hibernate. For lazy loading to work from both databases I want to use the OpenSessionInViewFilter. How do I configure this for multiple sessionfactories?

    Thanks!

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    The easiest solution would be to use one OSIV per session factory (exactly like you would for only one).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •