This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Jul 19, 2012 9:27 AM by 920261 RSS

Problems with "Grid Entity" Coherence configuration

920236 Newbie
Currently Being Moderated
I'm having trouble getting the "Grid Entity" Coherence configuration working. I'm on Oracle Coherence Version 3.6.0.4 Build 19111. I've carefully followed the instructions for the third coherence configuration scenario documented on the "JPA on the Grid" page [url http://docs.oracle.com/cd/E14571_01/doc.1111/e16596/tlcgd003.htm#CHDGGGAJ]here. I'll include snippets of the relevant files, but I think I've followed the docs closely. I must be missing something that the docs don't directly state? Any ideas would be greatly appreciated.

The problem I face is that when this "Grid Entity" Coherence mode is used, entities are not read from the database when the application starts up. The application behaves as if there is absolutely no data in the database even though I know I have rows in the tables backing my entities. In my dummy test app I'm also having problems persisting entities. If I temporarily disable coherence by commenting out the {noformat}@Customizer{noformat} Entity annotations everything works perfectly (the starting data set loads from the database as expected and new entities are persisted properly). If I change to the "Grid +Cache+" configuration things seems to be working properly. But that is not ideal since we want the Read/Write characteristics of Grid Entity.

Here's my coherence-cache-config.xml file (matches the documentation pretty much exactly):
<?xml version='1.0'?>
<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
   xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">
  <caching-scheme-mapping>
    <!--
      Map all entity classes to the eclipselink-distributed-readwrite scheme
-->
    <cache-mapping>
      <cache-name>*</cache-name>
      <scheme-name>eclipselink-distributed-readwrite</scheme-name>
    </cache-mapping>
  </caching-scheme-mapping>
  <caching-schemes>
    <distributed-scheme>
      <scheme-name>eclipselink-distributed-readwrite</scheme-name>
      <service-name>EclipseLinkJPAReadWrite</service-name>
      <!--
        Configure a wrapper serializer to support serialization of relationships.
      -->
      <serializer>
          <instance>
             <class-name>oracle.eclipselink.coherence.integrated.cache.WrapperSerializer</class-name>
          </instance>
      </serializer>
      <backing-map-scheme>
        <read-write-backing-map-scheme>
          <internal-cache-scheme>
            <local-scheme/>
          </internal-cache-scheme>
          <!-- 
             Define the cache scheme 
           -->
          <cachestore-scheme>
            <class-scheme>
              <class-name>oracle.eclipselink.coherence.integrated.EclipseLinkJPACacheStore</class-name>
              <init-params>
                <!-- This param is the entity name -->
                <init-param>
                  <param-type>java.lang.String</param-type>
                  <param-value>{cache-name}</param-value>
                </init-param>
                <!-- This param should match the persistence unit name in persistence.xml -->
                <init-param>
                  <param-type>java.lang.String</param-type>
                  <param-value>test-pu</param-value>
                </init-param>
              </init-params>
            </class-scheme>
          </cachestore-scheme>
        </read-write-backing-map-scheme>
      </backing-map-scheme>
      <autostart>true</autostart>
    </distributed-scheme>
  </caching-schemes>
</cache-config>
persistence.xml:
<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">
  <persistence-unit name="test-pu">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/WineDS</jta-data-source>
    <non-jta-data-source>jdbc/WineDS</non-jta-data-source>
    <class>datagridtest.WineEntity</class>
    <properties>
      <property name="eclipselink.target-server" value="WebLogic_10"/>
      <property name="eclipselink.target-database" value="Oracle11"/>
       <!--<property name="eclipselink.ddl-generation" value="create-tables"/>-->
    </properties>
  </persistence-unit>
</persistence>
entity class:
@Entity(name="Wine")
@NamedQueries({
  @NamedQuery(name = "Wine.findAll", query = "select o from Wine o"),
  @NamedQuery(name = "Wine.findByRegion", query = "select o from Wine o where o.region = :region"),
  @NamedQuery(name = "Wine.findByVintage", query = "select o from Wine o where o.vintage = :vintage"),
  @NamedQuery(name = "Wine.findByWinery", query = "select o from Wine o where o.winery = :winery")
})
@SequenceGenerator(name = "Wine Seq", sequenceName = "WINE_SEQ", allocationSize = 50, initialValue = 50)
@Customizer(CoherenceReadWriteCustomizer.class)
public class WineEntity implements Serializable {
     @Id
     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "Wine Seq")
     private Integer id;
     @Version
     private Integer version;
     
     private String name;
     
     private int vintage;
     
     private String region;
     
     private String winery;
     
     typical getters and setters follow...
     ....
     EJB snippets:
@Stateless(name = "SessionEJB", mappedName = "PortletProducerApplication-DataGridTest-SessionEJB")
public class SessionEJBBean implements SessionEJBLocal {
     @PersistenceContext(unitName="test-pu")
     private EntityManager em;
     
     ...
     
     public List<WineEntity> findAllWines() {
          TypedQuery<WineEntity> allWinesQuery = em.createNamedQuery("Wine.findAll", WineEntity.class);
          return allWinesQuery.getResultList();     
     }
     
     ...
     
}
Logs from server (IWLS):
<Jun 25, 2012 3:54:41 PM EDT> <Notice> <EclipseLink> <BEA-2005000> <2012-06-25 15:54:41.686--ServerSession(1768045153)--EclipseLink, version: Eclipse Persistence Services - 2.1.3.v20110304-r9073> 
<Jun 25, 2012 3:54:41 PM EDT> <Notice> <EclipseLink> <BEA-2005000> <2012-06-25 15:54:41.688--ServerSession(1768045153)--Server: 10.3.5.0> 
<Jun 25, 2012 3:54:42 PM EDT> <Notice> <EclipseLink> <BEA-2005000> <2012-06-25 15:54:42.142--ServerSession(1768045153)--file:/C:/Users/EDITED/AppData/Roaming/JDeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/TestApp/DataGridTestEJB.jar/_test-pu login successful> 
2012-06-25 15:54:42.502/58.626 Oracle Coherence 3.6.0.4 <Info> (thread=[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "jar:file:/C:/Oracle/Middleware/oracle_common/modules/oracle.coherence_3.6/coherence.jar!/tangosol-coherence.xml"
2012-06-25 15:54:42.513/58.637 Oracle Coherence 3.6.0.4 <Info> (thread=[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "jar:file:/C:/Oracle/Middleware/oracle_common/modules/oracle.coherence_3.6/coherence.jar!/tangosol-coherence-override-dev.xml"
2012-06-25 15:54:42.516/58.640 Oracle Coherence 3.6.0.4 <D5> (thread=[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
2012-06-25 15:54:42.524/58.648 Oracle Coherence 3.6.0.4 <D5> (thread=[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

Oracle Coherence Version 3.6.0.4 Build 19111
 Grid Edition: Development mode
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

2012-06-25 15:54:42.673/58.797 Oracle Coherence GE 3.6.0.4 <Info> (thread=[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded cache configuration from "file:/C:/workspaces/spaces_branch/TestApp/DataGridTest/src/coherence-cache-config.xml"
2012-06-25 15:54:43.360/59.484 Oracle Coherence GE 3.6.0.4 <D4> (thread=[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): TCMP bound to /172.30.112.202:8088 using SystemSocketProvider
2012-06-25 15:54:46.747/62.871 Oracle Coherence GE 3.6.0.4 <Info> (thread=Cluster, member=n/a): Created a new cluster "cluster:0xC4DB" with Member(Id=1, Timestamp=2012-06-25 15:54:43.377, Address=172.30.112.202:8088, MachineId=49866, Location=site:EDITED,machine:EDITED,process:10776, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=4, SocketCount=2) UID=0xAC1E70CA000001382535DD31C2CA1F98
2012-06-25 15:54:46.757/62.881 Oracle Coherence GE 3.6.0.4 <Info> (thread=[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Started cluster Name=cluster:0xC4DB

Group{Address=224.3.6.0, Port=36000, TTL=4}

MasterMemberSet
  (
  ThisMember=Member(Id=1, Timestamp=2012-06-25 15:54:43.377, Address=172.30.112.202:8088, MachineId=49866, Location=site:EDITED,machine:EDITED,process:10776, Role=WeblogicServer)
  OldestMember=Member(Id=1, Timestamp=2012-06-25 15:54:43.377, Address=172.30.112.202:8088, MachineId=49866, Location=site:EDITED,machine:EDITED,process:10776, Role=WeblogicServer)
  ActualMemberSet=MemberSet(Size=1, BitSetCount=2
    Member(Id=1, Timestamp=2012-06-25 15:54:43.377, Address=172.30.112.202:8088, MachineId=49866, Location=site:EDITED,machine:EDITED,process:10776, Role=WeblogicServer)
    )
  RecycleMillis=1200000
  RecycleSet=MemberSet(Size=0, BitSetCount=0
    )
  )

TcpRing{Connections=[]}
IpMonitor{AddressListSize=0}

2012-06-25 15:54:46.809/62.933 Oracle Coherence GE 3.6.0.4 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
2012-06-25 15:54:47.155/63.279 Oracle Coherence GE 3.6.0.4 <D5> (thread=DistributedCache:EclipseLinkJPAReadWrite, member=1): Service EclipseLinkJPAReadWrite joined the cluster with senior service member 1
INFO: Found persistence provider "org.eclipse.persistence.jpa.PersistenceProvider". OpenJPA will not be used.
INFO: Found persistence provider "org.eclipse.persistence.jpa.PersistenceProvider". OpenJPA will not be used.
[EL Info]: 2012-06-25 15:54:47.351--ServerSession(1901778202)--EclipseLink, version: Eclipse Persistence Services - 2.1.3.v20110304-r9073
[EL Info]: 2012-06-25 15:54:47.351--ServerSession(1901778202)--Server: 10.3.5.0
[EL Info]: 2012-06-25 15:54:47.551--ServerSession(1901778202)--EclipseLinkCacheLoader-test-pu login successful
And the error when trying to persist new entity:
javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: javax.persistence.OptimisticLockException: Exception [EclipseLink-5004] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: An attempt was made to update the object [datagridtest.WineEntity@1c59a6cc], but it has no version number in the identity map. 
It may not have been read before the update was attempted. 
Class> datagridtest.WineEntity Primary Key> 2,050
     at weblogic.ejb.container.internal.EJBRuntimeUtils.throwTransactionRolledbackLocal(EJBRuntimeUtils.java:238)
     at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:136)
     at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:650)
     at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:455)
     at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:52)
     at datagridtest.SessionEJB_qxt9um_SessionEJBLocalImpl.mergeWineEntity(Unknown Source)
So just to summarize, I'm currently seeing two problems: 1) No data pulled from database into Coherence and through to application--why won't coherence pull from database? and 2) what's this persist error about OptimisticLockException? Thanks again for any help.
  • 1. Re: Problems with "Grid Entity" Coherence configuration
    399257 Explorer
    Currently Being Moderated
    Hello Marc,
    What are you trying to achieve? With the Grid Entity configuration all queries will be issued against the Coherence cache if the "where" clause can be translated to a Coherence Filter. Queries against Coherence will only return the data present within the Coherence cache. If your desire is to always query against Coherence then your application will need to undergo a bulk load phase to ensure the data is loaded into the Coherence cache to be returned by the queries. Only EntityManager.find() calls and some simple find by pk queries can leverage the Coherence CacheLoader to load by PK from the database.
    The writes should be succeeding, with puts to the Coherence cache being persisted through the CacheStore that you have configured. Are any of the entities persisting through the CacheStore? Can you post the entire exception stack that is resulting?
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 2. Re: Problems with "Grid Entity" Coherence configuration
    920261 Explorer
    Currently Being Moderated
    Gordon,

    Thanks for your response. (I am working with Marc on this issue. FYI, we hadn't seen your response until just now because we thought we were correctly subscribed to this thread, but weren't.) What are we trying to achieve? We are trying to leverage Coherence caching to optimize query performance to our persistence database, without reading everything in bulk into the cache. Marc gave you a couple of simplified query examples in his post, but in reality, we are storing user information in a database and would like to make queries like this:

    select b from Bookmarks b where b.userId = :userId

    We don't really want to load every users' bookmarks into the cache in bulk. There will be users that don't access the application for long periods of time. But when a user is in the application, actively using this feature, we'd like to cache their data. The query above is pretty simple. We think that Coherence would be able to translate it into a Coherence Filter. (BTW, do you know if this translation requires that we use JPQL or do you think that this translation would work just as well with a query constructed with a CriteriaBuilder?) Ideally, we'd like Coherence to get this data from cache if it can, but to go to the database if it's not in cache, loading just this user's entities into cache when it does).

    It seemed as though "Grid Entity" was the right approach for making this work. But if there is another approach we should be taking, we'd love to here it.

    I don't have any details on the persist errors that Marc was seeing. Maybe he'll write back about those.

    Dave
  • 3. Re: Problems with "Grid Entity" Coherence configuration
    920236 Newbie
    Currently Being Moderated
    >
    I don't have any details on the persist errors that Marc was seeing. Maybe he'll write back about those.
    >
    The persist errors only showed up in a sample/dummy Wine app I set up to try to replicate the issue in a simpler context. Those persist errors didn't appear in the original application, so it's probably not worth worrying about the persist problem at this point.

    >
    we'd like Coherence to get this data from cache if it can, but to go to the database if it's not in cache, loading just this user's entities into cache when it does
    >

    Right, well put, and at this point we don't see the system (Coherence) falling back to the database upon such a cache "miss".

    Thanks for picking this up Dave, and thanks Gordon for your helpful reply.
  • 4. Re: Problems with "Grid Entity" Coherence configuration
    399257 Explorer
    Currently Being Moderated
    JPQL or Criteria API will both be translated to Coherence Filters when using GridRead or GridEntity.
    TopLink Grid has no way of knowing if the data in the cache is sufficient to satisfy the query, for example based on the provided Query how would TopLink-Grid determine between a user with no Books and insufficient data. Your application would have to programmatically determine that insufficient data was stored in the cache or perform an initial bulk load for a particular User by redirecting the query to the database. Grid queries can easily be redirected to the database by setting the IgnoreDefaultRedirector on the Query using query.setHint(QueryHints.QUERY_REDIRECTOR, new IgnoreDefaultRedirector()); Entities read from the database will be pushed to Coherence automatically.
  • 5. Re: Problems with "Grid Entity" Coherence configuration
    920261 Explorer
    Currently Being Moderated
    Ok, that makes sense. Thanks! I've tried your suggested query hint and it seems to work nicely. Thanks again!
  • 6. Re: Problems with "Grid Entity" Coherence configuration
    920261 Explorer
    Currently Being Moderated
    I am now having persist in our application. I've sorted out or read problems by manually detecting cache misses and adding the query hint to manually re-query the database. But persists are taking approximately 60 seconds to complete. Here's what happens when I try to persist a change (I am writing a custom portlet in WebCenter Spaces).

    1) I click the Save button on my form
    2) My action request handler is called and attempts to persist my change
    3) ~20 seconds pass and my portlet tries to refresh itself
    4) Upon refresh, a query is run to repopulate the form. It hits the cache.
    5) However, the cache entry contains a null value in the field that I updated.
    6) If I check the database table, it contains a null value in the field
    7) ~40 seconds pass and I manually refresh the portlet
    8) The correct updated value shows up in my form (and in my database table)

    For this test, I did not have a <write-delay> configured. All of my <read-write-backing-map-scheme> optional settings are unset.

    If I do set <write-delay>5s</write-delay>, I get different results. In this test, my portlet reports success right away. But the record that I tried to update still has the old value (in the cache and in the database). A write-behind never occurs. So, basically it just doesn't do anything.

    Any thoughts?

    Thanks,
    Dave
  • 7. Re: Problems with "Grid Entity" Coherence configuration
    ShaunSmith Explorer
    Currently Being Moderated
    917258 wrote:
    4) Upon refresh, a query is run to repopulate the form. It hits the cache.
    5) However, the cache entry contains a null value in the field that I updated.
    If you're using the Grid Entity configuration then on commit all changes are pushed into Coherence. If you're subsequently running a query on the cache and not seeing your changes it could be that the previous commit hasn't finished pushing updates into the cache. Are you certain the commit has completed before you try to refresh?

    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 8. Re: Problems with "Grid Entity" Coherence configuration
    920261 Explorer
    Currently Being Moderated
    Shaun Smith wrote:
    Are you certain the commit has completed before you try to refresh?
    Well, I'm not sure. When the user clicks Save I process the action in a method that looks essentially like this (dumbed down from my more complicated method):
    @ProcessAction(name = ACTION_UPDATE)
    public void processUpdateAction(ActionRequest request, ActionResponse response)
         throws PortletException {
         ...
         PersistenceLocal facade = (PersistenceLocal)InitialContext.doLookup(PERSISTENCE_EJB_JNDI_NAME);
         facade.mergeEntity(entity);
    }
    We've got an EJB called PersistenceBean that handles our JPA stuff. The mergeEntity(entity) method simply calls em.merge(entity).

    So, once the @ProcessAction method is finished, the portal goes ahead and refreshes the portlet, running its doView() code which refreshes the form, querying the cache again for the same data. I'm not sure what I'm supposed to be doing to make sure the commit has completed before this refresh occurs? I would assume that the em.merge(entity) call waits for the commit to complete.

    A thought... Maybe I've got some EclipseLink caching enabled that is messing with the Coherence caching? I don't have any EclipseLink cache settings set in my persistence.xml file, but maybe the default is to cache?

    Dave
  • 9. Re: Problems with "Grid Entity" Coherence configuration
    ShaunSmith Explorer
    Currently Being Moderated
    917258 wrote:
    >
    So, once the @ProcessAction method is finished, the portal goes ahead and refreshes the portlet, running its doView() code which refreshes the form, querying the cache again for the same data. I'm not sure what I'm supposed to be doing to make sure the commit has completed before this refresh occurs? I would assume that the em.merge(entity) call waits for the commit to complete.
    Coherence is not updated until the transaction commits. So if your refresh is happening before the transaction commits then that would explain why you don't see the changes right away. One way to deal with this would be to define the transactional behavior on the methods on a SessionBean that does the JPA interaction as REQUIRES_NEW. That way, upon return, the transaction will commit and Coherence updated prior to the subsequent refresh. This is not TopLink Grid specific behaviour. This is just standard JPA/EJB.
    A thought... Maybe I've got some EclipseLink caching enabled that is messing with the Coherence caching? I don't have any EclipseLink cache settings set in my persistence.xml file, but maybe the default is to cache?
    With TopLink Grid you have to enable EclipseLink caching (which is on by default) and then through the application of any of the TLG customizers the internal cache usage is disabled in favour of the external Coherence cache. So you're probably ok.

    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 10. Re: Problems with "Grid Entity" Coherence configuration
    920261 Explorer
    Currently Being Moderated
    Thanks Shaun,

    Adding REQUIRES_NEW didn't fix the problem, but it did reveal some new error messages that were helpful. (I'm using EJB 3.0, so I think the default is REQUIRES, which should have the same effect as REQUIRES_NEW considering that I am not explicitly creating any transactions anywhere.) It appears as though my transactions were timing out:

    javax.ejb.EJBException: Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds
    BEA1-008C2CE72FB49E472B1E

    I made a couple of changes that helped me get past the errors (but not necessarily the whole problem):

    1. I increased my portlet timeout from 20 seconds to 600. This prevented my portlet from giving up on my long transaction.
    2. I increased the JTA timeout from 30 seconds to 600. This allowed the transaction, which takes about 45 seconds, to finish.

    So, now my portlet works without error. But of course I'm not happy with the 45 second turn-around time on commits. When I don't have Coherence configured, my commits are sub-second as I'd expect.

    Thanks for the info on the EclipseLink cache config.

    Dave
  • 11. Re: Problems with "Grid Entity" Coherence configuration
    ShaunSmith Explorer
    Currently Being Moderated
    917258 wrote:
    So, now my portlet works without error. But of course I'm not happy with the 45 second turn-around time on commits. When I don't have Coherence configured, my commits are sub-second as I'd expect.
    That's very strange. Are you connecting via Coherence Extend or with TCMP? Can you try a simple Java SE TLG client example connecting to the same cluster to see if you can pinpoint the issue?

    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 12. Re: Problems with "Grid Entity" Coherence configuration
    920261 Explorer
    Currently Being Moderated
    Well, honestly, I had to look up all of the acronyms you just asked me about. I'd assume I'm using TCMP, which appears to be the default. I have not configured Extend. In a previous post in this thread, my colleague Marc posted the coherence-cache-config.xml that we are using.

    I'm also not sure what TLG stands for (even after asking my friends Google and Wikipedia), but if you're talking about a simple Java application with a main() method, I can try to whip something up to see if it yields different results. That's a good idea. (If I'm missing the point on what TLG is, let me know. I'm assuming right now that you meant TLC and will write my test app with tender loving care.) I'll get back to you with the results of that test. Thanks for hanging in there with me.

    Dave
  • 13. Re: Problems with "Grid Entity" Coherence configuration
    ShaunSmith Explorer
    Currently Being Moderated
    917258 wrote:
    Well, honestly, I had to look up all of the acronyms you just asked me about.
    Sorry about that! ;)
    I'd assume I'm using TCMP, which appears to be the default. I have not configured Extend. In a previous post in this thread, my colleague Marc posted the coherence-cache-config.xml that we are using.
    You've looked it up but for those reading this thread, TCMP is "Tangosol Cluster Management Protocol" which is the high performance UDP based protocol Coherence uses. Coherence Extend supports connecting via TCP/IP.
    >
    I'm also not sure what TLG stands for (even after asking my friends Google and Wikipedia), but if you're talking about a simple Java application with a main() method, I can try to whip something up to see if it yields different results. That's a good idea. (If I'm missing the point on what TLG is, let me know. I'm assuming right now that you meant TLC and will write my test app with tender loving care.) I'll get back to you with the results of that test. Thanks for hanging in there with me.
    Lol! Yes please write up a simple Java app with a main() with some TCL (TLG is "TopLink Grid"). Let's try and diagnose TopLink Grid/Coherence issues independently of the Portal environment. BTW, is the cluster you're connecting to on the same subnet? TCMP is not designed to run across a WAN. Attempting to do so could lead to the behaviour you're seeing as your client may be booted from the cluster for taking to long to respond. I've seen behaviour where a client using TCMP running across a WAN was constantly joining and then leaving a cluster. Extend can be used in this case.

    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 14. Re: Problems with "Grid Entity" Coherence configuration
    920261 Explorer
    Currently Being Moderated
    For now, I've got everything on localhost. And I don't foresee any reason to run the cluster across a WAN. Thanks for the background on that, though.

    I have successfully implemented a small Java SE TLG app and it worked splendidly. Commits were very fast. I used the same JPA entities and the same coherence config. But there were a couple differences that I'll attempt to isolate.

    1) I configured a RESOURCE_LOCAL db connection in my persistence.xml file instead of the JTA connection I have defined in my portlet producer application. I'm trying to configure my portlet application to use RESOURCE_LOCAL right now to see if the issue lies there. But I'm having trouble with it. For some reason, persists aren't working at all when I use RESOURCE_LOCAL in my portlet. No errors. It just doesn't update the db or the cache. Strange. I'll muddle through that this morning hopefully.

    2) I used EntityManagerFactory to create my EntityManager rather than using my EJB. I doubt that this would cause my problem, but I can easily revert my portlet code to use the EntityManagerFactory to test this out if the JTA connection doesn't prove to be my issue.

    Perhaps my data source is my problem. I've tried using both the oracle.jdbc.OracleDriver and the oracle.jdbc.xa.client.OracleXADataSource drivers in my data source. I'm using the default settings for the data source's transaction settings, including "Supports Global Transactions" and "One-Phase Commit". But I'll worry about this only after I determine that RESOURCE_LOCAL works in my portlet.

    Dave
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points