Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] RE: Question on sequencing using TableGenerator

Hi Shashi,
Incrementing the sequence value on the database must be performed in an autonomous transaction.
If you are using a native sequence, then obtaining and incrementing the next sequence value on the database is a non-transactional operation anyway.
If you are using a TableGenerator, then EclipseLink will perform a select on the sequence value, the update and the commit all together in an autonomous transaction.
It might be reasonable that you configure a distinct data source for sequencing as for sequencing you definitely do not need to use XA and therefore you can use a non-XA-datasource. You can define as a persistence unit property named "javax.persistence.nonJtaDataSource".


Best regards,
Reinhard

-----Original Message-----
From: eclipselink-users-request@xxxxxxxxxxx [mailto:eclipselink-users-request@xxxxxxxxxxx] 
Sent: 20 July 2010 18:58
To: eclipselink-users@xxxxxxxxxxx
Subject: eclipselink-users Digest, Vol 35, Issue 21

Send eclipselink-users mailing list submissions to
	eclipselink-users@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
	https://dev.eclipse.org/mailman/listinfo/eclipselink-users
or, via email, send a message with subject or body 'help' to
	eclipselink-users-request@xxxxxxxxxxx

You can reach the person managing the list at
	eclipselink-users-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of eclipselink-users digest..."


Today's Topics:

   1. Question on sequencing using TableGenerator (Shashikant Kale)
   2. Auto Reply: [eclipselink-users] Question on sequencing using
      TableGenerator (gustavo.arango@xxxxxxxxxx)
   3. Auto Reply: [eclipselink-users] Question on sequencing using
      TableGenerator (neil.hauge@xxxxxxxxxx)
   4. Auto Reply: Auto Reply: [eclipselink-users] Question on
      sequencing	using TableGenerator (gustavo.arango@xxxxxxxxxx)
   5. Auto Reply: Auto Reply: [eclipselink-users] Question on
      sequencing	using TableGenerator (gustavo.arango@xxxxxxxxxx)
   6. Auto Reply: Auto Reply: [eclipselink-users] Question on
      sequencing	using TableGenerator (neil.hauge@xxxxxxxxxx)
   7. RE: Eclipselink in clustered environment. (Reinhard Girstenbrei)
   8. Auto Reply: [eclipselink-users] RE: Eclipselink in clustered
      environment. (gustavo.arango@xxxxxxxxxx)


----------------------------------------------------------------------

Message: 1
Date: Tue, 20 Jul 2010 22:19:11 +0530
From: Shashikant Kale <Shashikant.Kale@xxxxxxxxxxxxxxxx>
Subject: [eclipselink-users] Question on sequencing using
	TableGenerator
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <FDCD1F56CDE47840ADD853365BBE7FEF04C4B58337@indxchange03>
Content-Type: text/plain; charset="us-ascii"

Hi,

We have been using eclipselink and I have a question wrt eclipselink in clustered environment. We are using TableGenerator for generating primary keys and we use the same sequence for all the entities.

e.g.

      @GeneratedValue(strategy = GenerationType.TABLE, generator = "default")
      @TableGenerator(
            name = "default",
            table = "ID_GENERATOR",
            pkColumnName = "ID_NAME",
            valueColumnName = "ID_VALUE",
            pkColumnValue = "default",
            initialValue = 1,
            allocationSize = 50
      )

However I have found that the Select query is fired without "For Update" clause. Wouldn't this cause issues due to dirty reads across multiple JVMs?

Kindly let me know how this is taken care.

Thanks,
Shashi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://dev.eclipse.org/mailman/private/eclipselink-users/attachments/20100720/966388f1/attachment.html

------------------------------

Message: 2
Date: Tue, 20 Jul 2010 09:49:38 -0700 (PDT)
From: gustavo.arango@xxxxxxxxxx
Subject: Auto Reply: [eclipselink-users] Question on sequencing using
	TableGenerator
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <794a63e0-0f8a-405f-948e-aa53ce6d215a@default>
Content-Type: text/plain; charset=utf-8

i,

thanks for your email,
I'm currently off until the 23nd of august 2010.

For Any urgent issue , please contact my manager olivier.mikeladze@xxxxxxxxxx

thanks a lot.

regards,
Gustavo.


------------------------------

Message: 3
Date: Tue, 20 Jul 2010 09:49:39 -0700 (PDT)
From: neil.hauge@xxxxxxxxxx
Subject: Auto Reply: [eclipselink-users] Question on sequencing using
	TableGenerator
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <983bcb0e-6b83-4b21-b85e-7f3063396a21@default>
Content-Type: text/plain; charset=utf-8

I am out of the office with limited access to email from July 20th through the 26th.  Please contact karen.moore or shaun.smith with any urgent Dali related issues.  Please contact roger.striffler with any other urgent issues.

Thanks,
Neil


------------------------------

Message: 4
Date: Tue, 20 Jul 2010 09:51:48 -0700 (PDT)
From: gustavo.arango@xxxxxxxxxx
Subject: Auto Reply: Auto Reply: [eclipselink-users] Question on
	sequencing	using TableGenerator
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <b49f8c41-462d-46e0-bb5d-a271e5670cbf@default>
Content-Type: text/plain; charset=utf-8

i,

thanks for your email,
I'm currently off until the 23nd of august 2010.

For Any urgent issue , please contact my manager olivier.mikeladze@xxxxxxxxxx

thanks a lot.

regards,
Gustavo.


------------------------------

Message: 5
Date: Tue, 20 Jul 2010 09:51:54 -0700 (PDT)
From: gustavo.arango@xxxxxxxxxx
Subject: Auto Reply: Auto Reply: [eclipselink-users] Question on
	sequencing	using TableGenerator
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <039ed737-acdc-4945-81cc-67de59d54e30@default>
Content-Type: text/plain; charset=utf-8

i,

thanks for your email,
I'm currently off until the 23nd of august 2010.

For Any urgent issue , please contact my manager olivier.mikeladze@xxxxxxxxxx

thanks a lot.

regards,
Gustavo.


------------------------------

Message: 6
Date: Tue, 20 Jul 2010 09:51:47 -0700 (PDT)
From: neil.hauge@xxxxxxxxxx
Subject: Auto Reply: Auto Reply: [eclipselink-users] Question on
	sequencing	using TableGenerator
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <56335a74-264c-4f7d-8d83-2c6934c793af@default>
Content-Type: text/plain; charset=utf-8

I am out of the office with limited access to email from July 20th through the 26th.  Please contact karen.moore or shaun.smith with any urgent Dali related issues.  Please contact roger.striffler with any other urgent issues.

Thanks,
Neil


------------------------------

Message: 7
Date: Tue, 20 Jul 2010 09:57:02 -0700 (PDT)
From: Reinhard Girstenbrei <reinhard.girstenbrei@xxxxxxxxxx>
Subject: [eclipselink-users] RE: Eclipselink in clustered environment.
To: eclipselink-users@xxxxxxxxxxx
Message-ID: <2ca4ab2f-6d72-4174-b5f7-ae8e86fdd846@default>
Content-Type: text/plain; charset=utf-8

Hi Shashi,
I had been using the following code for the SessionCustomizer to configure RMI Cache Coordination on WebLogic Server:

public void customize(Session session) throws Exception {
		Server server = (Server) session;
		RemoteCommandManager commandMgr = 
		   new RemoteCommandManager((CommandProcessor) server);
		commandMgr.setUrl( System.getProperty("eclipselink.coordination.url"));
		commandMgr.setChannel("EclipseLinkChannel");
		commandMgr.setShouldPropagateAsynchronously(true);
		commandMgr.getDiscoveryManager().setPacketTimeToLive(0);
		RMITransportManager transportManager = new RMITransportManager(commandMgr);
		transportManager.setNamingServiceType(TransportManager.JNDI_NAMING_SERVICE);
	    
	    transportManager.setUserName("username");
	    transportManager.setEncryptedPassword("password");
	    transportManager.setInitialContextFactoryName( "weblogic.jndi.WLInitialContextFactory");
	    transportManager.setShouldRemoveConnectionOnError(true);
	    commandMgr.setTransportManager(transportManager);
	    server.setCommandManager(commandMgr); 
	    server.setShouldPropagateChanges(true);
	    if(server.isConnected ()) { 
	        server.getCommandManager().initialize(); 
	      } 
	      else 
	      { 
	        server.login();
	      }

	}

Using this code I can create a cluster of two WLS server instances running on the same machine. 
I just have to setup the right URL for the JNDI lookup for this current CommandManager as a startup java option with
-Declipselink.coordination.url=t3://hostname:port/...

I hope that helps.

Best regards,
Reinhard Girstenbrei

-----Original Message-----
From: eclipselink-users-request@xxxxxxxxxxx [mailto:eclipselink-users-request@xxxxxxxxxxx] 
Sent: 16 July 2010 18:00
To: eclipselink-users@xxxxxxxxxxx
Subject: eclipselink-users Digest, Vol 35, Issue 19

Send eclipselink-users mailing list submissions to
	eclipselink-users@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
	https://dev.eclipse.org/mailman/listinfo/eclipselink-users
or, via email, send a message with subject or body 'help' to
	eclipselink-users-request@xxxxxxxxxxx

You can reach the person managing the list at
	eclipselink-users-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of eclipselink-users digest..."


Today's Topics:

   1. Eclipselink in clustered environment. (Shashikant Kale)


----------------------------------------------------------------------

Message: 1
Date: Fri, 16 Jul 2010 10:58:28 +0530
From: Shashikant Kale <Shashikant.Kale@xxxxxxxxxxxxxxxx>
Subject: [eclipselink-users] Eclipselink in clustered environment.
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <FDCD1F56CDE47840ADD853365BBE7FEF04C4ACFF1E@indxchange03>
Content-Type: text/plain; charset="us-ascii"

Hello,

I am trying to setup eclipselink in clustered environment. We don't have JMS provider and hence would like to setup RMI based coordination for L2 cache. However I am finding it difficult to make it work. Looking at various examples and eclipselink cache coordination documentation at http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29#Cache_Coordination_API wrote following code
 in a SessionCustomizer

            session.setProperty("eclipselink.cache.coordination.protocol", "rmi");
            //Use default EclipseLinkCommandChannel for propagation
            CommandManager cm = new RemoteCommandManager((CommandProcessor)session);
            cm.setShouldPropagateAsynchronously(true);
            DiscoveryManager dm = cm.getDiscoveryManager();
            dm.setAnnouncementDelay(1000);
            dm.setMulticastGroupAddress("224.0.0.1");
            dm.setMulticastPort("2000");
            dm.setPacketTimeToLive(2);

However this doesn't seem to be working. I am sure I am missing something here. Does somebody have a working example of cache coordination setup using RMI?

TIA,
Shashi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://dev.eclipse.org/mailman/private/eclipselink-users/attachments/20100716/09a49c75/attachment.html

------------------------------

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


End of eclipselink-users Digest, Vol 35, Issue 19
*************************************************


------------------------------

Message: 8
Date: Tue, 20 Jul 2010 09:57:20 -0700 (PDT)
From: gustavo.arango@xxxxxxxxxx
Subject: Auto Reply: [eclipselink-users] RE: Eclipselink in clustered
	environment.
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Message-ID: <305e5894-de4b-4fe6-94e9-e0ed4a50c8f7@default>
Content-Type: text/plain; charset=utf-8

i,

thanks for your email,
I'm currently off until the 23nd of august 2010.

For Any urgent issue , please contact my manager olivier.mikeladze@xxxxxxxxxx

thanks a lot.

regards,
Gustavo.


------------------------------

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


End of eclipselink-users Digest, Vol 35, Issue 21
*************************************************


Back to the top