Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] Configuring a Coordinated cache via RMIin Java

Hrm.... well I am not seeing any sort of messages about multicast or RMI
messages in my code, though I am not explicitly closing the EMF or EM
objects (I have always been of  the philisophy from DBAs past that
closing connections are expensive so I let the system recycle them) - is
this required for the cache coordination to work? 

If I try to make the same query twice, I get this error in my logs for
some reason:

internal error: ObjID already in use

I tried setting up a second server and configuring the session.xml to
point at the first server host but nothing seems to be happening (and I
changed the RMI address to be machine address vs local host) - also do I
need an different RMI registrry for each different Persistence Unit I
have?  I have four in my persistence.xml file.

Thanks for any further help!

Tony

-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Doug Clarke
Sent: Wednesday, November 28, 2007 11:11 AM
To: EclipseLink User Discussions
Subject: RE: [eclipselink-users] Configuring a Coordinated cache via
RMIin Java

Tony,

I believe I got the basics working using the attached persistence.xml
and sessions.xml (both placed in the META-INF folder. I still need to go
a little further in my testing to get a second node configured for
verification but the log messages are encouraging about the lookup of
the RMI registry and the discover multicast message being sent.

My test harness is just:

	public static void main(String[] args) throws Exception {
	
java.rmi.registry.LocateRegistry.createRegistry(Registry.REGISTRY_PORT);

		EntityManagerFactory emf = Persistence
	
.createEntityManagerFactory("eclipselink.examples.jpa.cache.rmi");
		EntityManager em = emf.createEntityManager();

		em.find(Employee.class, 1);

		em.close();
		emf.close();

	}

I hope this helps.

Doug

-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx]On Behalf Of Vespa,
Anthony J
Sent: Wednesday, November 28, 2007 10:22 AM
To: EclipseLink User Discussions
Subject: RE: [eclipselink-users] Configuring a Coordinated cache via
RMIin Java


Hi Doug!  Thanks for the quick response!  I am eager to try out the
cache coordination - I will take a look through the extension documents.

Cheers,

Tony

-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Doug Clarke
Sent: Wednesday, November 28, 2007 10:19 AM
To: EclipseLink User Discussions
Subject: RE: [eclipselink-users] Configuring a Coordinated cache via
RMIin Java

Tony,

We are working on getting the full documentation up but even when that
is completed we'll still have work to do.

Here is the documentation on RMI Cache Coordination:
http://wiki.eclipse.org/Configuring_an_RMI_Coordinated_Cache_%28ELUG%29#
BABHEJHG. The bulk of this focuses on Workbench usage. 

I will assume since you are coming from TopLink Essentials that you are
looking for the JPA centric configuration approach using persistence.xml
properties and annotations.

The JPA documentation can be found at:

http://wiki.eclipse.org/EclipseLink/UserGuide/Developing_JPA_Projects_%2
8ELUG%29

But at present is not complete. I would recommend looking at the Oracle
TopLink JPA extensions doc and translating it for usage with
EclipseLink:

http://www.oracle.com/technology/products/ias/toplink/jpa/resources/topl
ink-jpa-extensions.html

You will need to use @Cache to configure the coordination type on each
entity. To configure the actual RMI coordination I would recommend using
a sessions.xml which the extensions document describes how to link in. 

I am working on a small example to illustrate the various pieces.

Doug

-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx]On Behalf Of Vespa,
Anthony J
Sent: Wednesday, November 28, 2007 9:29 AM
To: EclipseLink User Discussions
Subject: [eclipselink-users] Configuring a Coordinated cache via RMI in
Java


Hello,

So I am about to attempt setting up a coordinated cache with my entity
objects running on two server boxes via RMI.  As I am looking through
the documentation, I see most examples are for the workbench - are there
some straight java examples (as I am not using the workbench, I recently
migrated from Toplink essentials) - that offer a step by step guide to
setting it up in Java (annotations, where/how to config the JNDI
bindngs, etc)

Thanks for any help!

-Tony
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top