On Tue, 9 Aug 2011, [email protected] wrote:
Andrew
Thanks for replying.
I have couple more questions, could you please clarify ?
Will changing the ticket registry to use JpaTicket registry require
changing the service registry too ? I am currently using a
defaultTicketRegistry , InMemoryServi eRegistryDao in conjunction with
active directory and Spnego ?
The ticket registry and service registry are independent and can be stored
in different backends. I have my ticket registry using Memcache and my
service registry using MySQL (JPA), for example. If you want to keep
using the in-memory service registry, that will be fine.
The link that I am following specifies to configure a connection pool in
the deployerConfigContext.xml Could you please let me know what is this
datasource ?
https://wiki.jasig.org/display/CASUM/JpaTicketRegistry
I used that same wiki page to setup JPA, and I am using the c3p0
connection pooling. Here is what I added to my deployerConfigContext.xml:
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="generateDdl" value="true"/>
<property name="showSql" value="true" />
</bean>
</property>
<property name="jpaProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
p:driverClass="com.mysql.jdbc.Driver"
p:jdbcUrl="jdbc:mysql://hidden.oregonstate.edu:3306/cas?autoReconnect=true"
p:user="cas"
p:password="hidden"
p:initialPoolSize="5"
p:minPoolSize="5"
p:maxPoolSize="10"
/>
Then in spring-configuration/ticketRegistry.xml:
<bean id="ticketRegistry"
class="org.jasig.cas.ticket.registry.JpaTicketRegistry">
<constructor-arg index="0" ref="entityManagerFactory" />
</bean>
Good luck!
Andy
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user