Toplink Cache problem

I am using JDev of following version "Studio Edition Version 10.1.3.1.0.3984
Build JDEVADF_10.1.3.0_NT_061009.1404.3984".
I had an application with JSF and Toplink and am facing issues with toplink cache mechanism while TESTING IN JDEV . Following is the scenario.
1) When clicking on a link, say 'Get status' , i am querying data from database and displaying in JSF.
2) Later, i am updating particular record.
3) when i click on the link again (Get status), updated data is not gettng reflected.
Here is the code to get data and i am calling this method whenever i am clicking on 'Get status' link.
public Vector getMaintenanceStatusList(){
Vector lockersStatus = null;
try {
Session sess = ToplinkDBUtils.getTopLinkSession();
sess.validateCache();
ReadAllQuery query = new ReadAllQuery();
query.dontCheckCache();
query.dontMaintainCache();
query.setReferenceClass(LockerMaintenanceStatus.class);
query.useDistinct();
lockersStatus = sess.readAllObjects(LockerMaintenanceStatus.class);
} catch (DatabaseException e) {
e.printStackTrace();
//******** Printing the updated value.
for (Iterator i = lockersStatus.iterator();i.hasNext();){
LockerMaintenanceStatus tmp = (LockerMaintenanceStatus)i.next();
System.out.println("Status value :: "+tmp.getStatus());
return lockersStatus;
Here, i am getting old status value for second time though i have updated the database with new status. (scenario if i work in same browser with same toplink session)
i am getting updated values only when i restart the JDEV oc4j.
Please let me know how i can solve the problem.
Thanks!
Veeraswami K

Veeraswami,
In your code you are constructing a query but are not executing it. Instead you are simply calling session.readAllObjects. The result of this call will be the cached versions (based on default cache config).
I would recommend doing:
ReadAllQuery query = new ReadAllQuery(LockerMaintenanceStatus.class);
query.refreshIdentityMapResult();
lockersStatus = (Vector) sess.executeQuery(query);The other settings you had used would bypass the cache and not result in its results being refreshed.
Doug

Similar Messages

  • Refreshing TopLink cache problem

    Hello,
    Assume I configure TopLink to cache Class1 and Class2 objects. Class1 is related with Class2 with one-to-one relationship, and Class2 is related with Class1 with one-to-many relationship, Class2 is parent of Class1. When I invalidate instance of Class1 and its parent instance of Class2 with
    session.getIdentityMapAccessor().invalidateObject(object);
    session.getIdentityMapAccessor().invalidateObject(object.getParent());
    and read Class1 by Id with ReadObjectQuery, object of Class1 is refreshed from database, however, if I try to access its parent with Class1#getParent(), that parent is stale, it is not automatically refreshed from database. When I read it (invalidated parent object) with ReadObjectQuery by ID, it is refreshed from database.
    Is there any way to force TopLink to refresh objects that have been invalidated automatically without querying them by ID? If object A of type Class1 has been invalidated, object B of type Class2 has been invalidated, object A references its parent B and I query A by ID, I would like TopLink to refresh not only A, but B object too.

    If the parent is invalidated, then when you access the refreshed Class1's parent the parent should be refreshed. Are you sure you are invalidating both the Class1 and its parent before reading Class1?
    Otherwise I am not sure why you are seeing it not being refreshed.
    Perhaps try this on another object to see if it is something specific to how you have mapped the object.
    Otherwise enable FINEST logging and include the TopLink log.

  • Problem of Toplink cache

    when we try to get a object form DB by Toplink, the number of sub-object is doubule or treble,
    for example: object User and object Role are many-to-many Mapping relation,get User form DB,sometime returns 4 Roles,sometime 8 Roles or 12 Roles, but the correct result is 4 Roles.
    I don't konw why.

    Yes,have only 4 unique rows in the relation table,this problem doesn't happened debug in Eclipse,just appeared on OC4J,so i suspect this is cache problem,
    the query code:
    //get the ClientSession
    ClientSession cs = getClientSession();
    Expression exp = (new ExpressionBuilder()).get("oid").equal(oid);
    User user= cs.readObject(User.class, exp);
    the User class:
    public class User extends BaseEntity {
         private String ID;
         private String localName;
         private String firstName;
         private String lastName;
         private String stat;
         private String email;
         private String phone;
         private String fax;
         private String sourceAppCode;
         private Date lastLoginRangeBegin;
         private Date lastLoginRangeEnd;
         private ArrayList roleList;
         public String getID() {
              return ID;
         public void setID(String id) {
              ID = id;
         public void setStat(String stat) {
              this.stat = stat;
         public String getStat() {
              return stat;
         public void setEmail(String email) {
              this.email = email;
         public String getEmail() {
              return email;
         public void setPhone(String phone) {
              this.phone = phone;
         public String getPhone() {
              return phone;
         public void setFax(String fax) {
              this.fax = fax;
         public String getFax() {
              return fax;
         public void setSourceAppCode(String sourceAppCode) {
              this.sourceAppCode = sourceAppCode;
         public String getSourceAppCode() {
              return sourceAppCode;
         public void setRoleList(ArrayList roleList) {
              this.roleList = roleList;
         public ArrayList getRoleList() {
              return roleList;
         public void setLastLoginRangeBegin(Date lastLoginRangeBegin) {
              this.lastLoginRangeBegin = lastLoginRangeBegin;
         public Date getLastLoginRangeBegin() {
              return lastLoginRangeBegin;
         public void setLastLoginRangeEnd(Date lastLoginRangeEnd) {
              this.lastLoginRangeEnd = lastLoginRangeEnd;
         public Date getLastLoginRangeEnd() {
              return lastLoginRangeEnd;
         public void setLocalName(String localName) {
              this.localName = localName;
         public String getLocalName() {
              return localName;
         public void setFirstName(String firstName) {
              this.firstName = firstName;
         public String getFirstName() {
              return firstName;
         public void setLastName(String lastName) {
              this.lastName = lastName;
         public String getLastName() {
              return lastName;
    }

  • Toplink cache coordination problem with opmn lookup

    Dear all,
    We encounter some problems when we use opmn url and jms to realize the toplink cache coordination.
    Scenario:
    1. Using oracle application server 10g, create three processes(jvm) on one oc4j instance
    2. Using oc4j in memory jms server for cache coordination
    3. Using opmn url to lookup jms topic connection factory and connection, opmn url: opmn:ormi://shasudv4:6004:OC4J_TTS/tts
    When we start oc4j instance, we find the log, all the toplink cache coordination properites has been set to toplink framework, and remote command manager has been initialized successfully. All in memory jms server has also been started successfully, there are three listeners on the topic.
    But, when we test the synchronization, the data can't be synchronized between all the processes, two of them is ok, the rest of them has some problem to coordinate with the other two. There are no exceptions, we have set the level of toplink log to 'all'.
    I have checked the thread dump, I find that "HTTPThreadGroup", "RMICallHandler" and "JMSRequestHandler" threads are involved in cache synchronization.
    So, we are obliged to change the opmn url to ormi url, so we can only set a bound for rmi ports of processes, because the ormi port is dynamicly assigned.
    <port id="rmi" range="12405-12407" />
    This seems ok, and involved thread are: "RMICallHander" and "JMSRequestHandler". But we also concern that we have restricted the port bound of ormi port of every instance.
    Thanks of any advice.

    I raised a TAR with Oracle. The short answer is that you can't do cache coordination either with ADF business objects, or with Toplink Essentials (as opposed to Oracle Toplink, which doesn't yet support JPA).

  • Toplink Installation Problem

    I'm creating a small prototype application and am having a problem retrieving data from the DB. The queries generated by TopLink don't contain a SELECT field list. Notice the query output in the TopLink log is "SELECT FROM USERS WHERE (ID > 1)". In looking at my generated project file, I can't see what the problem is. It looks identical to the demo projects I've looked at.
    I've tried calling readAllObjects() on 2 different objects, 1 with all DIRECT_TO_FIELD mappings and another with an added ONE_TO_ONE mapping. Both of these objects create a SQL statement with an empty SELECT clause.
    Any ideas what is going on? Is this a license key issue?
    Nate
    My client source code:
    GreenSpringProject project = new GreenSpringProject();
    oracle.toplink.threetier.Server servSession = project.createServerSession();
    // This clears the TopLink cache for the purposes of this demo only
    servSession.initializeIdentityMaps();
    servSession.logMessages();
    out.println("START: readAllExample()<BR>");
    Expression exp = new ExpressionBuilder().get("id").greaterThan(1);
    Vector users = servSession.readAllObjects(User.class, exp);
    out.println("Read " + users.size() + " users:<BR>");
    for (int i=1; i < users.size(); i++ ) {
         for (Enumeration enum = users.elements(); enum.hasMoreElements(); ) {
              User user = (User) enum.nextElement();
              out.println("Now Reading Addresses for Employee No: " + i++ + " of " + users.size() + "<BR>");
              out.println("  " + user + ",  " + user.getAddress() + "<BR>");
    The TopLink Log Output:
    ServerSession(6702726)--Connection(2112561)--TopLink, version:TopLink - 9.0.3 (Build 423)
    ServerSession(6702726)--Connection(2112561)--connecting(DatabaseLogin(
    platform => OraclePlatform
    user name => "bowler"
    datasource URL => "jdbc:oracle:thin:@localhost:1521:greenspg"
    ServerSession(6702726)--Connection(2112561)--Connected: jdbc:oracle:thin:@localhost:1521:greenspg
    User: BOWLER
    Database: Oracle Version: Oracle8i Release 8.1.6.0.0 - Production
    JServer Release 8.1.6.0.0 - Production
    Driver: Oracle JDBC driver Version: 8.1.7.0.0
    ServerSession(6702726)--Connection(2112561)--SELECT FROM USERS WHERE (ID > 1)

    So, just to carry this thread a little bit longer..
    If this a web application, it would make sense to do this ONCE in the application when loading:
    GreenSpringProject project = new GreenSpringProject();
    oracle.toplink.threetier.Server servSession = project.createServerSession();
    servSession.initializeIdentityMaps();
    servSession.logMessages();
    servSession.login();
    Then, in any business object that needs to perform an action against the DB, it should get a ClientSession with:
    oracle.toplink.threetier.ClientSession cliSession = servSession.acquireClientSession();
    OR (if updating an object) get a UnitOfWork with a call to:
    UnitOfWork uow = servSession.acquireUnitOfWork();
    Is this correct?
    Any other tips/explanations on this? I'm finding that the TopLink docs are heavy with mapping and configuration options, but lite on "Best Practices". Any references that could help?
    Nate
    After executing project.createServerSession(), you should take the results ServerSession object and explicitly call serverSession.login().
    Also, you should get in the habit of not executing queries directly against the ServerSession (ie serverSession.readAllObjects(...) ). Instead, acquireClientSession() and execute your query against the resulting ClientSession object.
    JIM
    I'm creating a small prototype application and am having a problem retrieving data from the DB. The queries generated by TopLink don't contain a SELECT field list. Notice the query output in the TopLink log is "SELECT FROM USERS WHERE (ID > 1)". In looking at my generated project file, I can't see what the problem is. It looks identical to the demo projects I've looked at.
    I've tried calling readAllObjects() on 2 different objects, 1 with all DIRECT_TO_FIELD mappings and another with an added ONE_TO_ONE mapping. Both of these objects create a SQL statement with an empty SELECT clause.
    Any ideas what is going on? Is this a license key issue?
    Nate
    My client source code:
    GreenSpringProject project = new GreenSpringProject();
    oracle.toplink.threetier.Server servSession = project.createServerSession();
    // This clears the TopLink cache for the purposes of this demo only
    servSession.initializeIdentityMaps();
    servSession.logMessages();
    out.println("START: readAllExample()<BR>");
    Expression exp = new ExpressionBuilder().get("id").greaterThan(1);
    Vector users = servSession.readAllObjects(User.class, exp);
    out.println("Read " + users.size() + " users:<BR>");
    for (int i=1; i < users.size(); i++ ) {
         for (Enumeration enum = users.elements(); enum.hasMoreElements(); ) {
              User user = (User) enum.nextElement();
              out.println("Now Reading Addresses for Employee No: " + i++ + " of " + users.size() + "<BR>");
              out.println(" " + user + ", " + user.getAddress() + "<BR>");
    The TopLink Log Output:
    ServerSession(6702726)--Connection(2112561)--TopLink, version:TopLink - 9.0.3 (Build 423)
    ServerSession(6702726)--Connection(2112561)--connecting(DatabaseLogin(
    platform => OraclePlatform
    user name => "bowler"
    datasource URL => "jdbc:oracle:thin:@localhost:1521:greenspg"
    ServerSession(6702726)--Connection(2112561)--Connected: jdbc:oracle:thin:@localhost:1521:greenspg
    User: BOWLER
    Database: Oracle Version: Oracle8i Release 8.1.6.0.0 - Production
    JServer Release 8.1.6.0.0 - Production
    Driver: Oracle JDBC driver Version: 8.1.7.0.0
    ServerSession(6702726)--Connection(2112561)--SELECT FROM USERS WHERE (ID > 1)

  • How do I sync Toplink Cache with my Database?

    Hey guys,
    We are running macro's through an excel sheet that connects to the database and performs Updates and Inserts.
    Since this database update is NOT taking place through TopLink (in a Unit of Work) - we do not see the database changes through the web app on the front end unless we bounce our webserver. Presumably the Toplink cache is re-built on start up...so then we can see the changes.
    My question is, what can I do to make sure the TopLink cache is aware of the database changes we have made through the macro without having to bounce the server? Is there a re-fresh or sync command that can be run?
    This task is sort of a one time thing, so I don't want a solution that involves the cache going to sync itself on a schedule or anything like that. Maybe bouncing is the best solution?
    Thoughts?
    We are using Toplink 9.0.4
    Thanks.

    Hello,
    Because it is a one time thing, if you can make sure no other TopLink process are going on, you can probably get away with initializeAllIdentityMaps() or the intitializeIdentityMap(Class) methods on the session. These will clear the identity maps, having the obvious draw back of removing all object identity which will cause problems with running processes though. It might be better than bouncing the server - it depends on the application. Logging out of the session and logging back in has the same effect of clearing the cache, but with a bit more overhead. Benifit is that running processes will get errors if they continue to use the session, rather than strange behaviior if they continue to use objects after identity is lost.
    Another alternative is to run refresh queries on the data you know might be in the cache or that might have been affected. Drawbacks are that this brings them into the cache if they are not already there.
    TopLink 9.0.4 is a quire a few versions back, and in newer versions there is cache invalidation. An object marked as invalid is not removed, so object identity is maintained, but on the next query the data will be refreshed - ensuring subsequent queries will get results from the database without having to be told explicietly to refresh or being set to always refresh. Invalidation can be triggered on particular objects, classes or the entire cache or different policies can be set to set a time to live etc.
    Except for bouncing the server or logging out of the session, all of the above leave some possibility that a concurrent user will still have a reference to stale data and continue to use it after the process has run on the database. So I hope you use optimistic locking and that your batch process updates the version to avoid other process from overwriting with stale data.
    Best Regards,
    Chris

  • Database Change Notification and TopLink Cache Invalidation

    Has someone succeeed in implementing the How-to Database Change Notification and TopLink Cache Invalidation.
    I have corrected some document errata about the pl/sql content and I manage to have messages in the 'notify_queue'.
    I obtain the Topic in Java from this queue.
    But the TopicSuscriber instances do not receive any message. Is there something to have in mind to make it work ?
    Regards.

    Reviving this thread again...
    I am using DCN feature to build a middle-tier cache. I know oracle has problem sending physical rowid in case of 'Index Organized Table', however, in normal table also its not able to send proper rowid.
    e.g, I have 2 records in Table A with rowid AAARIUAAGAAAV/uABw and AAARIUAAGAAAV/pAAX.
    I have updated both the records. Strangely for the first record, oracle is sending INVALID rowid, although for the second record its sending the valid one.
    Following is the output:
    Row 1:  (Wrong rowid being sent, AAARIUAAGAAAV/uABw is replaced with AAARIUAAGAAAXDCAAr)
    Connection information  : local=localhost.localdomain/127.0.0.1:47633, remote=localhost.localdomain/127.0.0.1:2278
    Registration ID         : 2102
    Notification version    : 1
    Event type              : OBJCHANGE
    Database name           : <sid>
    Table Change Description (length=1)
        operation=[UPDATE], tableName=<table_name>, objectNumber=70164
        Row Change Description (length=1):
          ROW:  operation=UPDATE, ROWID=AAARIUAAGAAAXDCAAr
    Row 2:  (Right rowid being sent, AAARIUAAGAAAV/pAAX)
    Connection information  : local=localhost.localdomain/127.0.0.1:47633, remote=localhost.localdomain/127.0.0.1:2278
    Registration ID         : 2102
    Notification version    : 1
    Event type              : OBJCHANGE
    Database name           : <sid>
    Table Change Description (length=1)
        operation=[UPDATE], tableName=<table_name>, objectNumber=70164
        Row Change Description (length=1):
          ROW:  operation=UPDATE, ROWID=AAARIUAAGAAAV/pAAX
    Any idea ?

  • ValueHolder Indirection and TopLink Cache

    We have a parent object A (main table) and child object B (a lookup table), mapped thought ValueHolder Indirection.
    We use ReadAllQuery to build SQL and retrieve object A(s), and associated B(s).
    The query result is used to populate a web page table.
    The problem is that when the table is populated, the exact same lookup query against object B is repeated without checking cache. That data field is populated by object_A.object_b.description. For example, below same query would be repeated many times when loading up the web page table:
    Select description_id, description from Table_B where description_id = 1
    Why the query generated by this Indirection not checking cache? Anyway to force it to check TopLink cache first before querying against database?
    Thanks for any help!
    Jeffrey

    Thanks for the reply.
    We use JDeveloper 10.1.3.2. TopLink map in JDev is used to map all table objects and their relationships. So In TopLink map, object(table) A has a ValueHolder object(table) B through indirection. The primary key of B is: description_id, which is used in the table reference mapping.
    We use the default TopLink settings in JDev, so object B has below settings in TopLink map:
    Identity Map: FullIdentityMap
    Size: 50 (there are only about 20 records in this lookup table)
    Existence Checking: Check Cache
    We don't have any other caching mechanism other than TopLink's. EJB 3.0 is used as service bean, and External Transaction Controller (OC4J) is used.
    How to check if B is already in the TopLink cache? I heard ReadAllQuery always goes to database w/o checking TopLink cache, but in the case, the query generated by lazy loading indirection is after the ReadAllQuery execution (when the web page table is loading up).
    Jeffrey

  • Child Objects  and TopLink Cache

    All,
    I have a problem RE the TopLink cache:
    Object A has a Vector of Object Bs (1:M) and Object B has a Vector of Object Cs(1:M). I am using ValueHolderInterface and indirection pattern for each of these Vectors.
    When I update an Object C, it is not refreshed the next time I read Object A using the readObject(expression). I can see the changes in the database. Can someone tell me the best way to refresh the cache to get the updated Object Cs that belong to Object A.
    What I am doing is updating the C objects that belong to object A (thru Vector B) and then retrieving them again in the very next method call. Hope this makes sense!
    Thanks!
    J

    There is something wrong with your test case, I've seen this before -- if you update a C, then without fail the cached version of C is updated and if you have a handle to the cached A that has the B that has the C in question, then you will see the update. It sounds like perhaps you're not actually looking at the cached A, but instead looking at it from a UOW, etc.
    Send me an email, it's simply my firstname . lastname at Oracle.com. I'll send you a UOW primer that should help better understand these semantics...
    - Don

  • Cluster config. - toplink cache

    hi all!
    A simple question...
    I've built an application using ADF and toplink.
    Actually the application runs on a single IAS.
    now, for load reasons, i'll need to migrate to a cluster configuration.
    Is there any kind of problem with the toplink cache?
    Thanks.
    Luca

    hi all!
    A simple question...
    I've built an application using ADF and toplink.
    Actually the application runs on a single IAS.
    now, for load reasons, i'll need to migrate to a cluster configuration.
    Is there any kind of problem with the toplink cache?
    Thanks.
    Luca

  • Querying TopLink Cache

    My system demands caching the result sets obtained from a ReadAllQuery. I might make several queries on this static set of cached data. But the data to be cached is small. I use TopLink's use session.getProject().FullIdentityMap() to cache the output of ReadAllQuery that i execute at the start of the system.
    But am not able to query the cache from an external API later ( which could be several minutes later). How can i manipulate the TopLink cache APIs to get this done. Kindly Reply.

    Hi Manoj,
    If I understand you correctly, you persist some objects and then later query them. You don't get the results you expect when you use checkCacheOnly(). You need to use checkCacheThenDatabase() and when you do this you're seeing SQL I expect.
    If your cache type for the class is FullIdentityMap then TopLink will never release objects of that class once read and your checkCacheOnly() query should work.
    I'm guessing that you're using a different TopLink session. You mention you have a number of services. What environment are you running in and what is your architecture (e.g., servlet or EJB)? Statics don't solve sharing problems especially in an application server or web application environment in which multiple classloaders are employed.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • TopLink Cache Out of Sync

    I have a situation where the application needs to handle inserts and updates, and deletes are handled by an oracle stored procedure on the database. My problem is after issuing any inserts/updates, then doing a delete of a record, it seems like that record is still in the toplink cache because trying to re-insert that deleted record fails until I restart the app server, then it works fine (until it's deleted again). Is there some way after calling the stored procedure to delete a record, to get the object in toplink updated correctly?
    I've tried a few different things including
    getUnitOfWork().unregisterObject(object);
    and
    getSession().getIdentityMapAccessor().invalidateObject(getObject(object));
    with no luck. Any suggestions?
    Nick

    You can set check existence to be check database instead of check cache.
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/uowadv001.htm#CACFHAAJ

  • Toplink Cache issues in Cluster

    Hi
    Our production environment is have a clustered environment and we have been noticing the following problem. When a user is trying to save a record she repeatedly encounters the "Toplink-5006" exception that I have included below.
    TopLink Error]: 2006.07.19 04:49:23.359--UnitOfWork(115148745)--null--Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]
    [TopLink Error]: 2006.07.19 04:49:23.359--UnitOfWork(115148745)--null--Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]
    <Jul 19, 2006 4:49:23 PM PDT> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setPeople(java.util.HashMap,java.lang.String,java.lang.String,java.lang.String,java.util.HashSet,com.rhii.mjplus.common.login.data.UserInfoDO)],Xid=BEA1-795A6481D2E1938A8EAD(115171166),Status=Rolled back. [Reason=Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=60,XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=rolledback,assigned=MS15_mjp),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@6dcf50b),SCInfo[mjp+MS15_mjp]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setPeople(java.util.HashMap,java.lang.String,java.lang.String,java.lang.String,java.util.HashSet,com.rhii.mjplus.common.login.data.UserInfoDO)], weblogic.jdbc=t3://10.253.129.56:2323}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MS15_mjp+10.253.129.56:2323+mjp+t3+, XAResources={},NonXAResources={})],CoordinatorURL=MS15_mjp+10.253.129.56:2323+mjp+t3+): Local Exception Stack:
    Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object [[email protected]ce459] cannot be updated because it has changed or been deleted since it was last read.
    Class> com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink_CMP_2_0 Primary Key> [1001280937, 0]
         at oracle.toplink.exceptions.OptimisticLockException.objectChangedSinceLastReadWhenUpdating(Ljava/lang/Object;Loracle/toplink/queryframework/ObjectLevelModifyQuery;)Loracle/toplink/exceptions/OptimisticLockException;(OptimisticLockException.java:109)
    What is puzzling is that the occurance of this nature has increased with user load and the toplink cache does not seem to have been refreshed after it encounters the first Optimistic Lock exception. We have run several test and this is not reproducabile in the DEV environment where we do not have a clustered set. After making a few updates to a record users starts experiencing the problem ... for some this persist for a really long time.
    We do not have Cache synchronization
    Cluster setup is as followes
    There are 4 boxes and each box has one admin and 4 managed servers.
    I have included the toplink-cmp-people.xml ( Thisis the particular entity bean we have a problem with) Our application server is Weblogic and we have Toplink version 9042
    <toplink-ejb-jar>
    <session>
    <name>People</name>
    <project-class>
    com.rhii.mjplus.fo.people.beans.PeopleToplink
    </project-class>
    <login>
    <datasource>MJPool</datasource>
    <non-jts-datasource>MJPool</non-jts-datasource>
    </login>
    <use-remote-relationships>true</use-remote-relationships>
    <customization-class>com.rhii.mjplus.common.TopLinkCustomization
    </customization-class>
    </session>
    </toplink-ejb-jar>
    I would appreciate any kind of feedback
    Thanks
    Lakshmi

    Can you refresh that record using a query before you save it ?
    Hi
    Our production environment is have a clustered
    environment and we have been noticing the following
    problem. When a user is trying to save a record she
    repeatedly encounters the "Toplink-5006" exception
    that I have included below.
    TopLink Error]: 2006.07.19
    04:49:23.359--UnitOfWork(115148745)--null--Exception
    [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2)
    (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937, 0]
    [TopLink Error]: 2006.07.19
    04:49:23.359--UnitOfWork(115148745)--null--Exception
    [TOPLINK-5006] (TopLink (WLS CMP) - 10g (9.0.4.2)
    (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937, 0]
    <Jul 19, 2006 4:49:23 PM PDT> <Error> <EJB>
    <BEA-010026> <Exception occurred during commit of
    transaction Name=[EJB
    com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setP
    eople(java.util.HashMap,java.lang.String,java.lang.Str
    ing,java.lang.String,java.util.HashSet,com.rhii.mjplus
    .common.login.data.UserInfoDO)],Xid=BEA1-795A6481D2E19
    38A8EAD(115171166),Status=Rolled back.
    [Reason=Exception [TOPLINK-5006] (TopLink (WLS CMP) -
    10g (9.0.4.2) (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937,
    0]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=0,seconds
    left=60,XAServerResourceInfo[weblogic.jdbc.wrapper.JTS
    XAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrap
    per.JTSXAResourceImpl]=(state=rolledback,assigned=MS15
    _mjp),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@6dcf
    50b),SCInfo[mjp+MS15_mjp]=(state=rolledback),propertie
    s=({weblogic.transaction.name=[EJB
    com.rhii.mjplus.fo.people.beans.PeopleManagerBean.setP
    eople(java.util.HashMap,java.lang.String,java.lang.Str
    ing,java.lang.String,java.util.HashSet,com.rhii.mjplus
    .common.login.data.UserInfoDO)],
    weblogic.jdbc=t3://10.253.129.56:2323}),OwnerTransacti
    onManager=ServerTM[ServerCoordinatorDescriptor=(Coordi
    natorURL=MS15_mjp+10.253.129.56:2323+mjp+t3+,
    XAResources={},NonXAResources={})],CoordinatorURL=MS15
    _mjp+10.253.129.56:2323+mjp+t3+): Local Exception
    Stack:
    Exception [TOPLINK-5006] (TopLink (WLS CMP) - 10g
    (9.0.4.2) (Build 040311)):
    oracle.toplink.exceptions.OptimisticLockException
    Exception Description: The object
    [com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLin
    k_CMP_2_0@6dce459] cannot be updated because it has
    changed or been deleted since it was last read.
    Class>
    com.rhii.mjplus.fo.people.beans.People_z2e2a7__TopLink
    CMP2_0 Primary Key> [1001280937, 0]
    at
    t
    oracle.toplink.exceptions.OptimisticLockException.obje
    ctChangedSinceLastReadWhenUpdating(Ljava/lang/Object;L
    oracle/toplink/queryframework/ObjectLevelModifyQuery;)
    Loracle/toplink/exceptions/OptimisticLockException;(Op
    timisticLockException.java:109)
    What is puzzling is that the occurance of this nature
    has increased with user load and the toplink cache
    does not seem to have been refreshed after it
    encounters the first Optimistic Lock exception. We
    have run several test and this is not reproducabile
    in the DEV environment where we do not have a
    clustered set. After making a few updates to a record
    users starts experiencing the problem ... for some
    this persist for a really long time.
    We do not have Cache synchronization
    Cluster setup is as followes
    There are 4 boxes and each box has one admin and 4
    managed servers.
    I have included the toplink-cmp-people.xml ( Thisis
    the particular entity bean we have a problem with)
    Our application server is Weblogic and we have
    Toplink version 9042
    <toplink-ejb-jar>
    <session>
    <name>People</name>
    <project-class>
    com.rhii.mjplus.fo.people.beans.PeopleToplink
    </project-class>
    <login>
    <datasource>MJPool</datasource>
    <non-jts-datasource>MJPool</non-jts-datasource>
    </login>
    <use-remote-relationships>true</use-remote-relationsh
    ips>
    <customization-class>com.rhii.mjplus.common.TopLinkCu
    stomization
    </customization-class>
    </session>
    </toplink-ejb-jar>
    I would appreciate any kind of feedback
    Thanks
    LakshmiCan you refresh that record using a query before you save it ?

  • Toplink Cache sync using JMS

    Hi,
    I am using toplink cache synchronization using Orion JMS. While starting the application I get the following erorr message.
    Oracle apps server version is 10.1.2.0.0 toplink 9.0.4.5
    Local Exception Stack:
    Exception [TOPLINK-15016] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.SynchronizationException
    Exception Description: Could not gain access to SynchronizationService class
    Internal Exception: Exception [TOPLINK-15013] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.SynchronizationException
    Exception Description: Could not find JMS Service Topic named: jms/MyCacheSyncTopic
    Internal Exception: javax.naming.NameNotFoundException: jms/MyTopicFactory not found
    at oracle.toplink.exceptions.SynchronizationException.errorGettingSyncService(SynchronizationException.java:139)
    at oracle.toplink.remote.CacheSynchronizationManager.initialize(CacheSynchronizationManager.java:114)
    at oracle.toplink.publicinterface.DatabaseSession.login(DatabaseSession.java:534)
    at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:250)
    at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:181)
    at com.starkey.cqm.dao.PersistenceService.initializeService(PersistenceService.java:67)
    at com.starkey.cqm.bcs.CQMServiceManager.createService(CQMServiceManager.java:68)
    at com.starkey.cqm.web.util.CQMInitServlet.init(CQMInitServlet.java:40)
    I have made the modifications in sessions.xml as follows
              <cache-synchronization-manager>
                   <clustering-service>oracle.toplink.remote.jms.JMSClusteringService</clustering-service>
                   <jms-topic-connection-factory-name>jms/MyTopicFactory</jms-topic-connection-factory-name>
                   <jms-topic-name>jms/MyCacheSyncTopic</jms-topic-name>     
              </cache-synchronization-manager>
    Changes in JMS xml
    <topic name="MyCacheSyncTopic" location="jms/MyCacheSyncTopic"/>
    <topic-connection-factory
              host="cqtest1"
              port="3702"
              name="Cache Sync Topic Factory"
              location="jms/MyTopicFactory" />
    Has any one encountered this before ?
    Thanks
    Priya

    Hi Steve,
    Servers 1 and 2 may have dropped the connections to 3. One way that this can happen is if at some point an object delta is sent to a target server that does not have the object deployed, or on its classpath. Make sure that log-debug is turned on for the TopLink session. You should see warnings on servers 1 and 2 about the connections being dropped to 3.
    If none of this seems to help or if you can't find the answers from the debug traces then the logs of the three servers would help support in determining where the problem occurred.
    -Mike

  • Toplink cache growing until OutOfMemoryError

    Hello,
    We are using OC4J 9.0.3 with toplink 9.0.3 on IBM AIX J2RE 1.3.1. From time to time, the JVM crashes with an OutOfMemoryError. Analysing the JVM heap dump, we have found that there are a lot of objects of the same type in the toplink cache:
    # of objects: 48 047
    Total size in bytes: 165 874 992
    The identity map settings for the project caching this object type are:
    Type: SoftCacheWeakIdentityMap
    Size: 100
    My understanding is that most of the 48 047 objects should be referenced as a weak references and that some of them should have been garbage collected by the VM instead of throwing an OutOfMemoryError.
    Could it be a problem in the JVM garbage collector ?
    May I use a CacheIdentityMap to work around the problem ?
    Do you have any advice ?
    Thank you in advance for any hint,
    Pierre Laroche

    Being in production I am not sure how much you can debug the system, but to determine if it is an issue with the weak references you could clear out the cache through an initializeAllIdentityMaps call on the session when the system is using most of the memory? This will remove all objects from the TopLink identity map removing the WeakReferences. This call should not be completed on a system still servicing requests though. Is it possible that there is a leak in the application that is preventing the WeakReferences from being garbage collected?
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • ICan I update Lr3 to recognize RAW files from Canon EOS T5?

    I just got a Canon EOS Rebel T5 and now I find out that Lightroom 3 doesn't recognize it's CR2 (RAW) files. The link below states that Lr 5.4 is the minimum Lr version required to read these files. Camera Raw plug-in | Supported cameras My question i

  • Problem with downloading documents

    Over the past couple of weeks everytime I have tried to download a documents on  my Macbook Pro using Firefox is has given a 'failed' message. I am on Lion 10.7.5. Any advice appreciated.

  • Smart View 11.1.2.1 - Single Sign On Error

    Hello experts, we are using EPM 11.1.2 (Essbase Standalone mode) with Smart View 11.1.2.1. We have to authenticate several times and we get the following error: "Single sign on external authentication is disabled. Do you want to connect with user nam

  • CFolders 4.0

    Hello, I was able to successfully initiate a WebEx meeting within cFolders 3.1. With the same settings when I try to initiate a WebEx meeting within cFolders 4.0 I am getting the following error: The following error text was processed in the system:

  • Foxfire add on says yahoo toolbar is downloaded, but it won't

    I have tried to fix this over 20 times and searched everywhere for answers. My yahoo toolbar stopped working and doesn't show any icons. I unchecked, then checked the view, toolbar, yahoo toolbar. I've tried to redownload the toolbar all evening and