Hm, perhaps a bit more concrete question. Do I need to configure multiple session factories, or can I stick to a single configuration? If so, how do I set up an "Open Session In View Pattern" in Spring and Jersey?
PS. here's the config in my hibernate entitites project.
Code:
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost:5432/company</property>
<property name="connection.username">***</property>
<property name="connection.password">***</property>
<property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="current_session_context_class">thread</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<mapping class="com.company.entities.Entity1" />
<mapping class="com.company.entities.Entity2" />
<mapping class="com.company.entities.EntityN" />
</session-factory>
</hibernate-configuration>