users@glassfish.java.net

Re: EclipseLink Coordinated Cache

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 12 Jun 2009 00:27:52 +0530

This is useful. Any chance of you writing an article or blog on this?

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> I seem to have EclipseLink working in GlassFish. I chose to use JMS for Cache Coordination rather than RMI. I created a SessionCustomizer to handle this as follows:
>
> public void customize(Session session) throws Exception {
> RemoteCommandManager rcm = new RemoteCommandManager((CommandProcessor) session);
> java.util.Properties props = new java.util.Properties();
> props.put(Context.PROVIDER_URL,"");
> props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
>
> JMSTopicTransportManager tm = new JMSTopicTransportManager(rcm);
> tm.setLocalContextProperties(props);
> tm.setRemoteContextProperties(props);
> tm.setTopicName("jms/cacheCoordinationTopic");
> tm.setTopicConnectionFactoryName("jms/ConnectionFactory");
> tm.setUserName("admin");
> tm.setPassword("admin");
>
> rcm.setTransportManager(tm);
>
> ((DatabaseSession)session).setCommandManager(rcm);
> ((DatabaseSession)session).setShouldPropagateChanges(true);
>
> rcm.initialize();
> }
>
> We found it best if you use a stand-alone JMS server, such as OpenMQ, and configure GlassFish to utilize that for the JMS Messaging rather than relying on the EMBEDDED JMS server that comes pre-configured in GlassFish.
> [Message sent by forum member 'cmathrusse' (cmathrusse)]
>
> http://forums.java.net/jive/thread.jspa?messageID=350760
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>