Flushing Toplink/JPA entity cache following background update of database

We have a JPA/Toplink web application (essentailly read only at present) and the database tables are to be refreshed from master tables at intervals (probably daily).
Is there any way (short of bouncing the web app) we can persuade Toplink to dump it's entity cache so the web app is guaranteed to pick up the new values promptly?

I seem to have an answer at last, for the benefit of forum searchers. Looks like:
http://www.jroller.com/LordFoom/
((oracle.toplink.essentials.ejb.cmp3.EntityManager)em.getDelegate()).getServerSession().getIdentityMapAccessor().invalidateAll(); Does the trick.

Similar Messages

  • How can we maintain External cache in TopLink JPA

    Hi,
    JPA maintains shared session cache for the purpose of multiple users .Individual user can not use this shared session cache . How can we maintain that individual user cache in TopLink JPA . In our application we are using container managed transactions.
    Regards
    Sucharitha.

    I'm not sure I understand, perhaps you could clarify your question?
    Do you want to access an object from the shared cache? There is a TopLink JPA query hint "return-shared" to allow for read-only shared objects to be returned on a query.
    If you do not wish to have a shared cache, you can set the cache to be isolated (see @Cache annotation, or persistence property "eclipselink.cache.shared.<class>").
    You can also access the shared cache directly using getServerSession().getIdentityMapAccessor().

  • Toplink Sessions and Caching

    Hi
    I've got a external import on my DB, which updates the database without toplink. => cache is after update not uptodate.
    So I've tried to run after every update of the DB:
    getClientSession().getIdentityMapAccessor().initializeAllIdentityMaps();
    (running on a oracle.toplink.sessions.Session - Object)
    How can i refresh the cache for all Sessions, not only the actual ClientSession? Or is ther just one session (the actual ClientSession) for Toplink? The application is a webbased application with more then one user....
    getClientSession is implemented as follow:
    public Session getClientSession() {
    try {
         mySessionBroker = (SessionBroker) SessionManager.getManager().getSession(TOPLINK_SESSION_NAME, AbstractService.class.getClassLoader());
         Session clientSession = (Session) mySessionBroker.acquireClientSessionBroker();
    clientSession.setSessionLog( new Log4jSessionLog() );
         clientSession.setLogLevel(ClientSession.LOG_DEBUG);
    //clientSession.logMessages();
         return clientSession;
    catch (Exception e) {
    throw new RuntimeException(new ClicToplinkException(e));
    }

    I realize this is an old thread so I apologize for dragging it back up.
    I am trying to get a handle on the cache invalidation methods. We need to invalidate the cache based on sporadic manual updates and I would like to figure out the best methodology for doing this. I believe that the IdentityMapAccessor.invalidateAll() method is the one I need to use but can't get it to work. What follows is my test case. this.manager is an entity manager created in a setup method:
    this.manager.getTransaction().begin();
    this.user = new FormularyUser();
    this.user.setSecurityUserID(12345L);
    this.manager.persist(this.user);
    this.manager.getTransaction().commit();
    Session session = ((EntityManagerImpl)this.manager.getDelegate()).getServerSession();
    session.getIdentityMapAccessor().invalidateAll();
    // this should lookup from DB
    FormularyUser copy2 = this.manager.find(FormularyUser.class,this.user.getUserPK());
    assertTrue(copy2 != null);
    assertTrue(copy2 != this.user);
    It would be my assumption that the invalidated cache result would not be returned but as I traced through the code I noticed this comment:
    'Override the getFromIdentityMapWithDeferredLock method on the session to ensure that invalidated objects are always returned since this is a UnitOfWork'
    Does this mean because I'm still in the same unit of work that I will get invalid objects back? I would assume that because I had committed the transaction that I would be in a new UnitOfWork. Can someone point out where I'm making the wrong assumptions or what I'm doing wrong?
    Thanks,
    Drew

  • TopLink - JPA - Jdeveloper 11g

    Hi All,
    I am having a TopLink - JPA example. I am executing a InsertExample.java which will insert record. But as I run InsertExample.java I keep getting following error.
    I am using Jdeveloper 11 g (and NOT Eclipse). How to get rid of following error ?
    "C:\Program Files\Java\jdk1.6.0_22\bin\javaw.exe" -client -classpath C:\MyJdevUserHomeEnv\mywork\TopLinkDesign\.adf;C:\MyJdevUserHomeEnv\mywork\TopLinkDesign\TopLink\classes;C:\Oracle\MiddlewarePS3\modules\com.oracle.toplink_1.0.0.0_11-1-1-4-0.jar;C:\Oracle\MiddlewarePS3\modules\org.eclipse.persistence_1.0.0.0_2-1.jar;C:\Oracle\MiddlewarePS3\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.toplink_11.1.1\javax.persistence_2.0_preview.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;C:\downloads\toplink_111130_en.zip;C:\downloads\coherence-java-3.6.0.0b17229.zip;C:\downloads\coherence-java-3.6.0.0b17229\coherence\lib\coherence.jar;C:\downloads\eclipselink-2.1.1.v20100817-r8050\eclipselink\jlib\eclipselink.jar;C:\downloads\toplink_111130_en\jlib\toplink-grid.jar;C:\Oracle\MiddlewarePS3\jdeveloper\ide\macros\..\..\..\wlserver_10.3\server\lib\ojdbc6.jar;C:\Oracle\MiddlewarePS3\jdeveloper\ide\macros\..\..\..\oracle_common\modules\oracle.nlsrtl_11.1.0\orai18n.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;C:\Oracle\MiddlewarePS3\oracle_common\modules\oracle.dms_11.1.1\dms.jar -Djavax.net.ssl.trustStore=C:\Oracle\MiddlewarePS3\wlserver_10.3\server\lib\DemoTrust.jks gridcache.example.InsertExample
    [EL Info]: 2010-11-20 19:58:59.418--ServerSession(30936685)--EclipseLink, version: Eclipse Persistence Services - 2.1.2.v20101006-r8316
    [EL Warning]: 2010-11-20 19:58:59.425--java.lang.ClassNotFoundException: weblogic.version
    [EL Info]: 2010-11-20 19:58:59.855--ServerSession(30936685)--file:/C:/MyJdevUserHomeEnv/mywork/TopLinkDesign/TopLink/classes/_employee-pu login successful
    [EL Info]: 2010-11-20 19:58:59.855--JMX MBeanServer instance found: [com.sun.jmx.mbeanserver.JmxMBeanServer@146c1d4], # of beans: [20], domain: [DefaultDomain] at index: [0].
    [EL Warning]: 2010-11-20 19:58:59.861--Failed to initialize MBean threadPoolRuntime: javax.management.InstanceNotFoundException: com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean
    [EL Warning]: 2010-11-20 19:58:59.862--Failed to initialize MBean threadPoolRuntime: javax.management.InstanceNotFoundException: com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean
    Exception in thread "main" java.lang.IllegalArgumentException: Object: Employee(0: Smith, Bob) is not a known entity type.
    *     at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4198)*
    *     at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:403)*
    *     at gridcache.example.InsertExample.main(InsertExample.java:29)*
    Process exited with exit code 1.

    It seems this is not a Java EE deployment so is the Employee class listed in the persistence.xml file? Or have you set <exclude-unlisted-classes>false</exclude-unlisted-classes> ? Alternatively you could package the classes into a Jar referenced through the <jar-file></jar-file> element.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • TopLink JPA  coherence

    we are using Toplink, JPA and coherence.
    can anyone point me to java code that depicts "How to warm up the coherence cache and then run queries against the cache. and then what happens if the at some point object is not in cache " ?
    thx
    D

    Warming the cache for a TopLink Grid enabled entity can be done by issuing a query for the objects you want to load into the cache along with the hint:
    query.setHint(QueryHints.QUERY_REDIRECTOR, new IgnoreDefaultRedirector());
    Which is discussed here: http://download.oracle.com/docs/cd/E14571_01/doc.1111/e16596/tlcgd003.htm#CHDGFCAI.
    You can also use JOIN and BATCH hints on the query if you want to load a graph of objects into the grid.
    With Grid Read and Grid Entity configurations all queries will be executed on the grid. Primary key queries on the grid for objects not present in the grid will result in a primary key select on the database if you've configured a CacheStore for a given entity's cache.
    Non-PK queries will only return what is in the grid. With Grid Read and Grid Entity is it your responsibility to ensure the grid is warmed up.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Toplink JPA Deployment problem  in OC4J

    Hi all ,
    we are having problem in deployment for an toplink JPA program in OC4J 10.1.3 .. We are using toplink essesntial and our deployed EAR structure is
    aaplication.xml
    rmwtoplink.war
    the content of application.xml is as
    <display-name>rmwtoplink</display-name>
    <module>
    <web>
    <web-uri>rmwtoplink.war</web-uri>
    <context-root>rmwapplist</context-root>
    </web>
    </module>
    the content of war file as below :
    web-inf\web.xml
    web-inf\classes\META-INF\persistence.xml
    web-inf\classes\<classes>
    web-inf\gnf\<jsp pages>
    when ever a pages are called those do not use entity manager / jpa call are loading perfectly , but the pages which have used jpa are nt diplayed , we check the error messages , it just halts after following codes :
    EntityManagerFactory emf =
    Persistence.createEntityManagerFactory(jpaSource);
    It seems there is no exception that is even thrown in page or opmn log .
    The same program is running fine in Jdveloper 10.1.3 /
    Is there any way where we can get the actual error message ?
    we are using toplink.jdbc.url for connecting the database .

    Here is little more insight for the problem , further check reveals that :
    start connecting rmwtest
    exception occured for connection test , Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    The Connection descriptor used by the client was:
    //localhost:1521/ORCL
    we do not have any idea how is localhost:1521/ORCL picked up , in our persistence.xml we have
    where as rmwtest defined in persistence.xml as
    <persistence-unit name="rmwtest" transaction-type="RESOURCE_LOCAL">
    <provider>oracle.toplink.essentials.PersistenceProvider</provider>
    <class>rmw.gnf.entity.ServSesnUser</class>
    <class>rmw.gnf.entity.RmwData</class>
    <class>rmw.gnf.entity.GnfData</class>
    <properties>
    <property name="toplink.logging.level" value="FINEST"/>
    <property name="toplink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="toplink.jdbc.url" value="jdbc:oracle:thin:@middb.1dc.com:1621:ukdbins"/>
    <property name="toplink.jdbc.user" value="****"/>
    <property name="toplink.jdbc.password" value="********"/>
    </properties>
    </persistence-unit>

  • Problem with JPA + Hibernate Validator when performing update

    When I try to insert an new entity with a validation problem, Hibernate Validator works normally, but when I try to update an entity the InvalidStateException is not thrown when persist() is called, so when commit() is called a RollbackException is thrown.
    I'm using the latest versions of the hibernate libraries. The problem happened with JSF(NetBeans 6 VWP) and Java SE.
    Sample code:
          EntityManagerFactory emf = Persistence.createEntityManagerFactory("HibernateValidatorTest");        
          EntityManager em = emf.createEntityManager ();       
          ScfaqAssunto assunto = em.find(ScfaqAssunto.class, 2); // new ScfaqAssunto() works normally
          assunto.setAssunto(""); // the property assunto is with @NotEmpty              
          try
             em.getTransaction().begin();
             em.persist(assunto);
             em.getTransaction().commit();
          catch(InvalidStateException e)
             if( em.getTransaction().isActive())
                em.getTransaction().rollback();
             for(InvalidValue invalidValue : e.getInvalidValues())
                System.out.println (invalidValue.getMessage());
          catch(Exception e)
             if(em.getTransaction().isActive())
                em.getTransaction().rollback();
             System.out.println(e.getMessage());
          finally
             em.close();
          } Thanks for any help,
    Felipe

    Hi Thomas
    I loose hours with this problem
    there is a problem with toplink lib version
    just download toplink librairies at http://www.oracle.com/technology/products/ias/toplink/jpa/index.html
    replace oldest in $Glassfishdir\lib
    It have to works
    tested on postGres and Derby
    Can netbeans update center fix this problem?

  • BMP Entity caching

    Hi,
    We are using BMP Entity beans on OC4J 9.0.2 and we have following problem:
    Every access to an entity bean invokes ejbLoad even if the bean is already loaded. Moreover, it's seems like OC4J re-uses instances of the beans instead of creating new instances. I mean that, for example, if we have a bean that was loaded with PK=1, and we're trying to load another bean with PK=2, OC4J invokes ejbLoad on first bean with the new PK.
    I've tried to increase max-instances and max-instances-per-pk without any success.
    I've changed validity-timeout to big number, again without success.
    I cannot change exclusive-write-access to true. OC4J always puts "false" there.
    I found couple of posts in this forum about BMP caching, but there was no any solution.
    Is there any solution to this problem?
    Thanks

    Stas -- There were a number of issues with EJB locking strategies in the v1022x. These included some scalability limits that we believed needed to be removed for enterprise systenms as well as being able to have true multi-JVM concurrency which was not easy to do with CMP in v1022x. Much of the exclusive-write-access code for non-read-only beans relied on these old mechanisms. A side effect of these changes was that for a small set of applications these changes might have some performance impact. We are looking to see how we might change this for the future but for the time being three methods exist to work around these issues. The first is to use TopLink for BMP. TopLink can provide caching that takes the place of the caching you were relying on in v1022x. The second it to use a caching mechanism like JCache that Avi described. The last and probably least desireable is to continue to use Oracle9iAS v0122x for your application.
    Realize that these changes were made to increase enterprise scalability beyond what was available in v0122x, not to negatively impact enterprise scalability.
    Laslty, it would be good to know if you are using multiple VMs in your application, if you manage multi-VM locking, and if the impact you are seeing is as great when you start to scale your application beyond a single VM.
    Thanks -- Jeff

  • Couldn't persist OneToMany JoinColumn/JoinTable (Unidir) using TopLink JPA

    Hi All,
    I am having a lot of difficulty deploying a OneToMany Unidirectional (Zipcode) record which consist of multiple Zipnames using TopLink on Glassfish v2r2, JDK1.6.0_06, MySQL 5.0, Netbeans 6.1 and Windows XP platform.
    Below are the relevant EJBs snippets:
    Zipcode class
    @Entity
    @Table(name="ZIPCODE")
    public class Zipcode implements Serializable {
    @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
    @JoinColumn(name="ZIPCODE_ID")    
                 or
        @JoinTable(name="ZIPCODE_ZIPNAME",          
                   joinColumns={@JoinColumn(name="ZIPCODE_ID")},
                   inverseJoinColumns={@JoinColumn(name="ZIPNAME_ID")})
        private Collection<Zipname> zipnames = new ArrayList<Zipname>();
        public Collection<Zipname> getNames()
         return zipnames;
        public void setZipnames(Collection<Zipname> zipnames)
         this.zipnames = zipnames;
    Zipname class does not maintain relationship back to Zipcode.
    public class ZipcodeApplicationClient {
    @PersistenceContext(unitName="GeographicalDB-PU")
    private static EntityManager manager;
        public ZipcodeApplicationClient() {
        public static void main(String[] args) {
            try {
                Zipcode zipcode_1 = new Zipcode();
                zipcode_1.setcode(9001);
                Zipname zipname_1 = new Zipname();
                zipname_1.setName("Harbour Cove");
                zipcode_1.getNames().add(zipname_1);
                // Can add one Zipname record with JoinTable but not JoinColumn
                Zipname zipname_2 = new Zipname();
                zipname_2.setName("Wonderland");
                zipcode_1.getNames().add(zipname_2);
                manager.persist(zipcode_1);   // line 45
    The same deployment error message below was generated from both JoinColumn and JoinTable methods:
    run-deploy:
    run-display-browser:
    run-ac:
    Copying 1 file to C:\Documents and Settings\Jack\GeographicalBean\dist
    Caught an unexpected exception!
    java.lang.NullPointerException
            at client.ZipcodeApplicationClient.main(ZipcodeApplicationClient.java:45)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
            at com.sun.enterprise.appclient.Main.main(Main.java:200)
    run-InvestmentBean-app-client:The JoinColumn method would not work for one Zipname record. On the other hand, JoinTable approach would allow us to add a single Zipname record without error out.
    Q1. Can you confirm whether TopLink JPA 1.0 (Glassfish v2r2) support OneToMany JoinColumn Unidirectional at all?
    Q2. Does TopLink JPA 1.0 (Glassfish v2r2) support OneToMany JoinTable Unidirectional? If so, what is the cause of this issue? Otherwise, please make appropriate recommendation steps to take.
    This question has been posted on http://forums.sun.com/thread.jspa?threadID=5330670&tstart=0 and http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=78&t=004489&p=1 earlier in the hope a quicker response.
    Your guidance would be very much appreciated.
    Many thanks,
    Jack

    Hi,
    Below are some more error output from the OneToMany JoinTable Unidirectional approach:
    pre-run-deploy:
    Initial deploying InvestmentBean to C:\Documents and Settings\abc\InvestmentBean\dist\gfdeploy
    Completed initial distribution of InvestmentBean
    Start registering the project's server resources
    Finished registering server resources
    moduleID=InvestmentBean
    deployment started : 0%
    deployment finished : 100%
    Deploying application in domain completed successfully
    Trying to create reference for application in target server completed successfully
    Trying to start application in target server completed successfully
    WARNING:
    JDO76614: Deployment encountered SQL Exceptions:
    JDO76609: Got SQLException executing statement "CREATE TABLE ZIPCODE (ID INTEGER NOT NULL, DIALING_CODE VARCHAR(255), TIME_ZONE VARCHAR(255), CODE INTEGER, NEAREST_AIRPORT VARCHAR(255), LONGITUDE VARCHAR(255), NEAREST_TRAIN_STATION VARCHAR(255), NEAREST_URBAN_CENTRE VARCHAR(255), HOTELS VARCHAR(255), LATITUDE VARCHAR(255), NEARBY_FEATURES VARCHAR(255), COUNCIL VARCHAR(255), LOCALITY VARCHAR(255), PRIMARY KEY (ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipcode' already exists
    JDO76609: Got SQLException executing statement "CREATE TABLE ZIPCODE_ZIPNAME (ZIPCODE_ID INTEGER NOT NULL, ZIPNAME_ID INTEGER NOT NULL, PRIMARY KEY (ZIPCODE_ID, ZIPNAME_ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipcode_zipname' already exists
    JDO76609: Got SQLException executing statement "CREATE TABLE ZIPNAME (ID INTEGER NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID))": com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zipname' already exists
    JDO76609: Got SQLException executing statement "ALTER TABLE ZIPCODE_ZIPNAME ADD CONSTRAINT FK_ZIPCODE_ZIPNAME_ZIPCODE_ID FOREIGN KEY (ZIPCODE_ID) REFERENCES ZIPCODE (ID)": java.sql.SQLException: Can't create table '.\geographicaldb\#sql-434_4.frm' (errno: 121)
    JDO76609: Got SQLException executing statement "ALTER TABLE ZIPCODE_ZIPNAME ADD CONSTRAINT FK_ZIPCODE_ZIPNAME_ZIPNAME_ID FOREIGN KEY (ZIPNAME_ID) REFERENCES ZIPNAME (ID)": java.sql.SQLException: Can't create table '.\geographicaldb\#sql-434_4.frm' (errno: 121)Enable of InvestmentBean in target server completed successfully
    Enable of application in all targets completed successfully
    All operations completed successfully
    post-run-deploy:
    run-deploy:
    run-display-browser:
    run-ac:
    Copying 1 file to C:\Documents and Settings\Jack\GeographicalBean\dist
    Caught an unexpected exception!
    java.lang.NullPointerException
    at client.ZipcodeApplicationClient.main(ZipcodeApplicationClient.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
    at com.sun.enterprise.appclient.Main.main(Main.java:200)
    run-GeographicalBean-app-client:
    run:
    I would like to correct an earleir comment where I stated that this method did work when adding a single Zipname record. This is no true.
    Thanks,
    Jack

  • Toplink JPA with Coherence deployment to Weblogic 10.3

    Hi,
    I have created an EJB application using Toplink JPA and Coherence. I would like to deploy this application to Weblogic 10.3.
    During the startup of Weblogic I have specified the Java option as
    -Dtangosol.coherence.cacheconfig=D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/CoherenceProject/src/META-INF/coherence-cache-config.xml.
    Persistence.xml and coherence-cache-config.xml are palced inside the jar file.
    When I execute the ejb client program, during the method call, I can see that coherence is started but it uses the cache-config from the coherence.jar file instaed of the value I have set during startup. How can I make weblogic use my cache-config.xml? I have included the log file entries from server:
    [EL Finest]: 2009.04.17 05:33:48.625--UnitOfWork(1777337)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query ReadObjectQuery(coherenceproject.MetadataType)
    2009-04-17 05:33:54.547/258.954 Oracle Coherence 3.4.2/411 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from resource "zip:D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/lib/coherence.jar!/tangosol-coherence.xml"
    2009-04-17 05:33:54.562/258.969 Oracle Coherence 3.4.2/411 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from resource "zip:D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
    2009-04-17 05:33:54.562/258.969 Oracle Coherence 3.4.2/411 <D5> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
    2009-04-17 05:33:54.578/258.985 Oracle Coherence 3.4.2/411 <D5> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.4.2/411
    Grid Edition: Development mode
    Copyright (c) 2000-2009 Oracle. All rights reserved.
    *2009-04-17 05:33:55.750/260.157 Oracle Coherence GE 3.4.2/411 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded cache configuration from resource "zip:D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/lib/coherence.jar!/coherence-cache-config.xml"*
    2009-04-17 05:34:17.390/281.797 Oracle Coherence GE 3.4.2/411 <D5> (thread=Cluster, member=n/a): Service Cluster joined the cluster with senior service member n/a
    2009-04-17 05:34:21.890/286.297 Oracle Coherence GE 3.4.2/411 <Info> (thread=Cluster, member=n/a): Created a new cluster "cluster:0x2FFB" with Member(Id=1, Timestamp=2009-04-17 05:34:09.203, Address=141.144.90.113:8088, MachineId=18289, Location=site:sg.oracle.com,machine:rajerama-sg,process:3816, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=1) UID=0x8D905A7100000120B0D9DD3347711F98
    2009-04-17 05:34:27.000/291.407 Oracle Coherence GE 3.4.2/411 <D5> (thread=DistributedCache, member=1): Service DistributedCache joined the cluster with senior service member 1
    [EL Finer]: 2009.04.17 05:34:28.343--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2
    [EL Fine]: 2009.04.17 05:34:28.703--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2 result: null
    [EL Finer]: 2009.04.17 05:34:28.703--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2
    *[EL Fine]: 2009.04.17 05:34:28.703--ServerSession(32927169)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Coherence(MetadataType)::Get: 2 result: null*
    null
    Eventhough the method is called correctly, it does not return the value. Is there any other setup that has to be done?
    Regards
    Raji

    Hi Raji,
    You mentioned:
    >
    -Dtangosol.coherence.cacheconfig=D:/JDEV_11g/jdeveloper/jdev/mywork/CoherenceApp/CoherenceProject/src/META-INF/coherence-cache-config.xml
    >
    and
    >
    Persistence.xml and coherence-cache-config.xml are palced inside the jar file.
    >
    It appears that these are conflicting; as the system property indicates that the config should be read from a file, whereas the file is actually deployed in a jar.
    That being said, I would suggest double checking that the system property is actually being set in the JVM. In my testing, if I specify a cache config that does not exist, an exception will be thrown:
    java -Dtangosol.coherence.cacheconfig=foo.xml  com.tangosol.net.CacheFactory
    Oracle Coherence Version 3.4.2/411p3
    Grid Edition: Development mode
    Copyright (c) 2000-2009 Oracle. All rights reserved.
    Map (?): cache test
    2009-04-22 15:33:15.310/6.917 Oracle Coherence GE 3.4.2/411p3 <Error> (thread=main, member=1):
    (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
            at com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:662)
            at com.tangosol.net.CacheFactory.getConfigurableCacheFactory(CacheFactory.java:602)
            at com.tangosol.coherence.component.application.console.Coherence.doCache(Coherence.CDB:9)
            at com.tangosol.coherence.component.application.console.Coherence.processCommand(Coherence.CDB:209)
            at com.tangosol.coherence.component.application.console.Coherence.run(Coherence.CDB:39)
            at com.tangosol.coherence.component.application.console.Coherence.main(Coherence.CDB:3)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at com.tangosol.net.CacheFactory.main(CacheFactory.java:1308)
    Caused by: (Wrapped: Failed to load configuration resource: foo.xml) java.io.IOException: Configuration is missing: "foo.xml", loader=null
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfigAsResource(DefaultConfigurableCacheFactory.java:386)
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:337)
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:309)
            at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfigurableCacheFactory.java:137)
            ... 15 moreThanks,
    Patrick

  • TopLink JPA doesn't persist Clob field when useStringBinding

    I'm using Toplink JPA on a JSF application deploying on Tomcat.
    Everything works fine except the table with Clob field.
    When insert data with size larger than 4KB, the error will occur.
    I did some searching and I fixed this by using SessionCustomizer.
    In my persistence.xml I put this
    <property name="toplink.session.customizer" value="com.my.sessions.MySessionCustomizer"/>
    and MySessionCustomizer is like this
    public class MySessionCustomizer implements SessionCustomizer {
         public void customize(Session session) throws Exception {
              DatabaseLogin login = session.getLogin();
              login.useStringBinding();
              login.setShouldBindAllParameters(false);
              login.dontCacheAllStatements();
    Things seem to work fine now but I found that Toplink does not persist the field that useStringBinding in database (Oracle 9i)
    eg. when I update an object into a table which has 1 clob field and some other field like VARCHAR2, all the data in non-clob fields are stored perfectly in Oracle but the data in Clob field just gone blank. It just gone blank in the database but in my application, it's still there. I mean as long as my session is still alive, everything seems to work fine from the application side. But when I start a new session, the data in the Clob is lost because it's not in the database.
    Why is this happening? Do I need to do anything extra when useStringBinding?
    It seems to me that the field with StringBinding just don't get into the database.
    Could somebody help me with this?

    This is an issue with the Oracle thin JDBC driver in that it has a 4k limit for LOBS. The best workaround is to use the Oracle OCI JDBC driver, which does not have this limitation (I think this limitation was also improved in the Oracle 10.2 thin JDBC driver).
    If you are using TopLink 10.1.3 a workaround to the JDBC issue is provided by using the Oracle9Platform and configuring the mapping for the CLOB to have a field-classification of java.sql.Clob.class.
    If you are using TopLink Essentials unfortunately this support is not currently available. I believe there is already an issue logged for this in Glassfish. If you cannot use the OCI driver you may need to insert the CLOB data using direct JDBC code.

  • Toplink JPA 2.0  migration in JDeveloper 11.1.1.2.0

    I would like to used Toplink JPA 2.0 in JDeveloper 11g, how to update toplink_111120_en.zip in JDeveloper IDE.? Even I added eclipselink and JPA 2.0 spec lib into classpath, I am still getting compile time error on orphanRemoval attribute in OneToMany annotation.

    Hi,
    I am not clear on the requirement.Let me know if my understanding is correct.
    You have a created a JPA project in Toplink Workbench and want to reuse the work in JDeveloper.
    If the above is correct,open the JDeveloper(PS3 release) and use the File-import-TopLinkworkbenchProject and select the application workspce created in TWB.
    Regards,
    Vinay

  • Toplink JPA LAZY loading in Java SE works without javaagent?

    hi there,
    I tought that mappings like
    @JoinColumn(name = "join_col_name")
    @ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    private RelatedObject relObj;
    with TopLink JPA in Java SE environment works ONLY with the
    -javaagent:toplink-essentials-agent.jar
    JVM parameter?
    the strange thing is: I did 2 test runs, with and without the java agent parameter. I also could see that in the first case the weaver is working, in the second the property "toplink.weaving=false" is printed to the console BUT if I access the LAZY mapped attribute of the object instance it works in both cases - I expected a NullPointerEx. in the case without the javaagent.
    Is there anything I missed?
    Hans

    Chris,
    thank for for the tip about verifying lazy or eager fetching. The results are interesting - or better: confusing - to me:
    I have built a test project with 3 entities:
    Entity A hast @OneToMany to Entity B and
    Entity B has ManyToONe to Entity C
    A <-- B --> C
    ALL relations are marked with FetchType.LAZY in all directions.
    When I simply run the test project via main()-method out of eclipse, WITHTOUT specifycing a -javaagent parameter in the run dialog, I can confirm using your test case that the realtion IS LAZILY FETCHED.
    So, I do not really know how this should work without the javaagent.
    You mentioned statically weaved classed - is this the default case when no agent is present, how is it done? Toplink logging says that weaving is NOT active:
    ServerSession(16821027)--Thread(Thread[main,5,main])--property=toplink.weaving; value=false
    so how can the lazy loading work then?
    regards,
    Hans

  • Toplink JPA and handle to a sequence

    Hi All,
    I am trying to figure out a way to get a handle to an Oracle sequence and use it from the java application i.e. run operations like currval/nextval.
    The reason I need this flexibility is to refer 2 sequences from the java app and apply it on a single table. Currently the table i am trying to insert already has a sequence which is a primary key generator. We do refer it in our JPA annotations and this works fine.
    But there was a need where another column (not part of Primary key) also needs its values from a different sequence.
    When we try to refer it from Toplink JPA it does not allow and errors stating cannot have 2 sequences mapping for a single table entity.
    Let me know your thoughts.
    Thanks

    You could use a native SQL query to get the nextval or curval from the Sequence.
    TopLink/EclipseLink should support an API for this, or allow multiple sequences per object, please vote for these bugs,
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=267701
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=320456
    James : http://www.eclipselink.org

  • TopLink JPA - trailing spaces on Char column

    Gurus,
    In JDBC you use the following to ignore trailing spaces when querying on Char column:
    OracleConnection conn = (OracleConnection) c;
    conn.setDefaultFixedString(true);
    How to achieve this using TopLink JPA?
    Thanks much,
    Nicky

    Nicky,
    I believe you would need to do this in API. Ideally setting these configurations on the properties of the JDBC connection pool is easier but if you wish to do it with TopLink Essentials I would use a session event listener's postAcquireConnection to customize it.
    In the persistence.xml you will need to configure your persistence unit to use a session customer like:
            <property name="toplink.session.customizer" value = "mypackage.JDBCConnectionConfig"/>Then you will need to implement this customizer and include it on the classpath of your application:
    public class JDBCConnectionConfig implements SessionCustomizer {
        public void customize(Session session) {
            session.getEventManager().addListener(new JDBCConfigEventListener());   
        class JDBCConfigEventListener extends SessionEventAdapter {
            public void postAcquireConnection(SessionEvent event) {
                Connection conn = ((DatabaseAccessor) event.getResult()).getConnection();
                OracleConnection oconn = (OracleConnection) conn;
                oconn.setDefaultFixedString(true);
    Note: I did not see setDefaultFixedString in the most recent version of the Oracle JDBC driver
    I would definitely look into configuring your data source's connection pool with this property enabled before adding this event listener.
    Doug

Maybe you are looking for

  • URGENT - HELP NEEDED WITH ECC 6.0 ACCESS KEY and USER SETUP

    Please help me with the two issues: 1) In ECC 6.0, When I go to SE12 , table V-FAGL_ACTIVEC (New GL Activation) to make the table display and maintenance allowed, I am asked for the access key. What is the access key that I am supposed to put here. W

  • Problems Installing Adobe Acrobat XI Pro via CreativeCloud on Windows 7

    The following error is from trying to install Acrobat XI pro. Everything else has installed (7 separate software bundles, from InDesign to Edge Reflow) and updated correctly. Exit Code: 7 Please see specific errors below for troubleshooting. For exam

  • Recommendations for 5.1 speakers for Apple TV

    Hello I'm looking to buy a set of surround speakers to attach to the Optical Audio out of the Apple TV. I would like as simple a set up as possible rather than a full-blown home theater system with amplifier. Does anyone have any recommendations for

  • Distributing several unplanned delivery costs.

    Hello, Is it possible to enter more than one unplanned delivery cost? I need to inform three unplanned delivery costs as follows: Example Unplanned delivery cost A: G/L 630100 Tax S3 Unplanned delivery cost B: G/L 630100 Tax S0 Unplanned delivery cos

  • Surround Surround Surround - 5.1 help needed

    I have been ripping MY! DVDs into an external HD to access in front row. The Mac mini is Optical Out to a 5.1 Surround system that supports ac3. I am using handbrake to rip the dvd's with the options apple says the new Quicktime will support. When I