NPE after session.getIdentityMapAccessor().removeFromIdentityMap(Object)

We have a need to be able to explicilty reset the TopLink global cache from time to time. We have a signficant number of ReadOnly (lookup & metadata) objects that we want to retain in cache and so want to avoid using the session.getIdentityMapAccessor.initializeAllIdentityMaps() api.
Some of our descriptors use inheritance policies and there are both ReadOnly and Updateable child descriptors involved in these hierarchies, so we cannot make use of the session.getIdentityMapAccessor.initializeIdentityMap(Class) api.
For Non-ReadOnly child descriptors (involving inheritance) our only option is to explicitly remove (or possibly invalidate) the object in the global cache. We chose the remove approach using the session.getIdentityMapAccessor().removeFromIdentityMap(object) api. We first query for all objects (readAllQuery - check cache only) for a specific Class and then iterate over the results calling removeFromIdentityMap(object) to evict the objects of that class from the cache.
This approach should be safe as none of our ReadOnly ojbects would ever reference a Non-ReadOnly object. We also are aware of the issues involving inflight transactions and non-deterministic results in those cases. We will be resetting the cache only under special circumstances and under controlled conditions.
After using the above approach, we are now encountering a NPE whenever we query for objects that involve inheritance. We see a database query get executed against the DB to retrieve the target object from the database, but when TopLink goes to query for a referenced object that involves inheritance the NPE occurs.
Here's the stack trace:
[container]--nulljava.lang.NullPointerException
     at oracle.toplink.publicinterface.DatabaseRow.getIndicatingNoEntry(DatabaseRow.java:269)
     at oracle.toplink.publicinterface.DatabaseRow.get(DatabaseRow.java:244)
     at oracle.toplink.publicinterface.InheritancePolicy.classFromRow(InheritancePolicy.java:260)
     at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:363)
     at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:455)
     at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:424)
     at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
     at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
     at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
     at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
     at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2073)
     at oracle.toplink.publicinterface.Session.executeQuery(Session.java:988)
     at oracle.toplink.publicinterface.Session.executeQuery(Session.java:960)
     at oracle.toplink.publicinterface.Session.executeQuery(Session.java:873)
We understand that objects involved in descriptor inheritance hierarchies all reside in the parent (root) identityMap.
We've verified our cache reset logic and verified that the cache appears to be reset properly (ReadOnly objects are still in cache, NonReadOnly objects have been successfully evicted from cache).
Any ideas on why this might be happening? Are there any special caveats with calling the removeFromIdentityMap(object) api when inheritance is involved?
Any other steps need to be taken?
Thanks in advance.
...Steve

Any takers on this? I'm still hoping to get some feedback/suggestions on solving this issue.
I did some further follow-up investigation. I get the exact same NullPointerException when I invalidate objects in cache instead of explicitly removing them using the session.getIdentityMapAccessor().removeFromIdentityMap(Object) api.
After doing the reset of the cache, (per the approach outlined above), as a test, I cycled through all of the descriptors, created a ReadAllQuery for each one and executed it within a try/catch block to catch and report the NPE. It seems only some of the Descriptors that had all objects in their identityMap invalidated throw the NPE. There does not appear to be an obvious pattern or reason for the NPE. Some of the descriptors are dead simple and only involve simple directToField mappings!
TopLink source code is not available for all of the components reported in the stack trace, so I can't identify the reason or logic behind what might be causing the NPE. I don't understand what the DatabaseRow.getIndicatingNoEntry(DatabaseRow) is doing nor why the InheritancePolicy is involved. The Descriptors don't involve inheritance!
Are there any guidelines or caveats regarding invalidating all objects in an IdentityMap? Is there any other cache life-cycle/re-iniitalization that needs to be considered? Or is it simply not possible to partially re-initialize/reset the IdentityMaps in a Database/Server Session?
Thanks for any help/advice offered.
...Steve

Similar Messages

  • OO4O process never killed/clean up after session=NULL

    After session object is set to NULL, still the oracle processes are in memory, never cleaned up. Does require any special methods to kill the process.
    dbObject.Close(); // called
    dbSession = NULL ; // set session object to null
    Oracle processes are still in memory and crashes server.
    Using Oracle ver 8.1.7/OO4O 3.15
    What is wrong here?
    Anyone came across similar issues..

    Have you tried to remove all OraParameters after stored procedure call and before assigning null to session?
    Otherwise there may be circullar references between OraDatabase and OraParameter causing memory leak after releasing your reference to OraSession.

  • After REFRESH the cached object is not consistent with the database table

    After REFRESH, the cached object is not consistent with the database table. Why?
    I created a JDBC connection with the Oracle database (HR schema) using JDeveloper(10.1.3) and then I created an offline database (HR schema)
    in JDeveloper from the existing database tables (HR schema). Then I made some updates to the JOBS database table using SQL*Plus.
    Then I returned to the JDeveloper tool and refreshed the HR connection. But I found no any changes made to the offline database table JOBS in
    JDeveloper.
    How to make the JDeveloper's offline tables to be synchronized with the underling database tables?

    qkc,
    Once you create an offline table, it's just a copy of a table definition as of the point in time you brought it in from the database. Refreshing the connection, as you describe it, just refreshes the database browser, and not any offline objects. If you want to syncrhnonize the offline table, right-click the offline table and choose "Generate or Reconcile Objects" to reconcile the object to the database. I just tried this in 10.1.3.3 (not the latest 10.1.3, I know), and it works properly.
    John

  • After scaling a smart object do I need to remake it as a smart object again?

    Using Photoshop CS5 - after scaling a smart object do I need to remake it as a smart object again?

    No! Just keep working with it you can adjust the original smart object file and retiuch it and all will update just click on the smart object  in the layers panel everything will work as you expect it to.

  • Redirecting user to login page after session expiry

    Hi,
    Default session expiry implementation in sap EP6.0 doesn't work properly. To overcome this, we have implemented one component where we check the idle time and throw the user back to the login page if the idle time has exceeded the session expiry period. This component has been added to desktop inner page as an iView. Following is the logic put in this component.
    IAuthentication ia = UMFactory.getAuthenticator();
    ia.logout(httpRequest, httpResponse);
    httpResponse.sendRedirect("/irj/portal");
    We are successfully getting the login page after session expiry. Issue is, our portal server is running on 11111 port. We cannot change this to 80 on unix because of unix limitations for the port number. So we have put one apache web server before our portal server. Apache web server is listening on port 80 and forwarding the request to our portal server.
    Now when user is redirected to the login page, url being shown in the browser is http://<host_name>:11111/irj/portal but I am expecting http://<host_name>/irj/portal (without port). I have tried putting the full url in sendRedirect() method but that too doesn't work.
    Any help is highly appreciated.
    Regards,
    Chandra

    Hi Chandra,
    Let the URL be relative in the sendRedirect i.e.
    httpResponse.sendRedirect("/irj/portal");
    However since you have a Reverse proxy in front, the response header for redirect will not contain the address of the reverse proxy in this case, your servername without port. You have to properly configure your reverse proxy so that the HTTP Headers are changed properly before sending the response to the users.
    Check this URL,
    http://httpd.apache.org/docs/1.3/mod/mod_proxy.html#proxypassreverse
    This gives you the details on configuring your apache.
    Hope this helps.
    Ankur
    P.S. If this helps please reward points.

  • How to disable  browser back button after session logout..

    Hi;
    I want to restrict the user to use the back button after session expired or logout. By doing the session expired we are restricting the user to do any new work but I want to restrict the user to see the back pages that he surfed previously in the session.
    Is there any method to disable the browser back button after the session Expired?
    please help me to find out the solution..
    Thanks in advance.
    With Regards,
    Haramohan

    One possible way is automatic return to the current page by writing the following Javascript code to the previous page:
    <script language=JavaScript>
    function backButtonOverride(){
    setTimeout("backButtonOverrideBody()", 1);
    function backButtonOverrideBody(){
    try {
    history.forward();
    } catch (e) {}
    setTimeout("backButtonOverrideBody()", 100);
    </script>
    <%
    catch(Exception e){
    %>
    <jsp:forward page="front.jsp"></jsp:forward>
    <%
    %>

  • Internal error: close session with active objects

    Please help on this error msg :
    Internal error: close session with active objects
    this happend during the decryption.

    Please help on this error msg :
    Internal error: close session with active objects
    this happend during the decryption.You have an error on line 42 of your decryption method.

  • Problem with ADF Faces; Bean (session scope) keeps Data after Session ends

    Hi,
    I have a project, which was transferred from an myFaces-project to an ADF Faces-project. Since i´am working with the ADF Faces the data in my beans (which are all in session-scope) won´t vanish after a logout.
    1) I have a method in one bean, which clears the user data (name and passwd), for example, but after a logout (redirecting to the login-page) I just have to push the loginbutton to get in the app. as the last user logged in. The bean is cleared, but where does the data come from. When the app was working with myFaces, this did not happen, the inputText and the inputHidden were empty.
    2) I have a af:table, which displays max ten lines. If the last user watched the elements 21 to 30 in that table, the next user who watches the table gets the same elements shown and not the elements 1 to 10. That shouldn´t happen in a different session.
    3) I have some listboxes in one page, where a user can make some decisions. If i logout and in again, i can see the decisions last made in these listboxes.
    All that happens with beans in session scope!
    Thanks for the replies (i hope) and excuse my bad english,
    Santiago

    Hi
    If this is the case , you can explicitly make all ur session data objects null.

  • Tomcat Session Tracking with Object Post and Repeated Applet Jar Download

    Hi there,
    I have an issue with session tracking in Tomcat (5.0.28) and the JRE repeatedly downloading the original Applet Jar.
    Everything works fine (session tracking and HTTP GETs) until I post an Object from the Applet to a Servlet and the Servlet reads the Object.
    After that happens the JRE downloads the Applet Jar about 20 times and continues to download it after further requests to the Servlet.
    Not sure if the following is related but I'm parsing XML returned by the Servlet in the Applet and I get the following in the Tomcat logs:
    127.0.0.1 - - [08/Feb/2005:08:43:12 +0000] "GET /[webapp_path]/servlet/META-INF/services/javax.xml.parsers.SAXParserFactory HTTP/1.1" 404 1142
    If I turn off the session tracking in the Servlet it all works fine.
    I'm using the standard HTTPSession tracking API.
    Any help is much appreciated as this is a serious issue!
    Ian

    ...furthermore...
    I've now found I had disabled caching in the JRE.
    If I enable it the immediately after a POST (not an Object) then the Applet is repeatedly downloaded and it appears more so than before.

  • PL/SQL to create a temp table that will be dropped after session ends

    Is it possible in PL/SQL to create a temp table that will be dropped after the session ends? Please provide example if possible. I can create a global temp table in PL/SQL but I am not sure how (if possible) to have it 'drop' once the session ends.
    DB: 10g
    OS: Wiindoze 2003 Server
    :-)

    As others have mentioned (but probably not clearly explained), Oracle treats temporary tables differently to SQL Server.
    In SQL Server you create a temporary table and it gets dropped (automatically I assume, I dont do SQL Server) after the session finishes. This will obviously allow each session to "request" a temporary table to use, then use it, and not have to worry about cleaning up the database after the session has finished.
    Oracle takes a different approach...
    On the assumption that each session is likely to be creating a temporary table for the same purposes, with the same structure, Oracle let's you create a Global Temporary Table a.k.a. GTT (which you've already come across). You only have to create this table once and you leave it on the database. This then means that any code written to use that table doesn't have to be dynamic code and can be verified and checked at compile time, just like code written for any other table. The difference of a GTT from a regular table is that any data you put into that table can only be seen by that session and will not interfere with any data of other sessions and, when you either commit, or end the session (depending on the "on commit delete rows" or "on commit preserve rows" option used when creating the GTT), that data from your own session will automatically be removed and hence the table is cleaned up that way, whilst the actual table itself remains.
    Some people from SQL Server backgrounds try and create and drop tables dynamically in their PL/SQL code, but this leads to problems...
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2    execute immediate 'create table my_temp (x number)';
      3    insert into my_temp values (1);
      4    execute immediate 'drop table my_temp';
      5* end;
    SQL> /
      insert into my_temp values (1);
    ERROR at line 3:
    ORA-06550: line 3, column 15:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 3, column 3:
    PL/SQL: SQL Statement ignoredi.e. the code will not compile for direct DML statements trying to use that table.
    They then try and get around this issue by making their DML statements dynamic too...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure my_proc is
      2  begin
      3    execute immediate 'create table my_temp (x number)';
      4    execute immediate 'insert into my_temp values (''A'')';
      5    execute immediate 'drop table my_temp';
      6* end;
    SQL> /
    Procedure created.... which looks great and it compiles ok... but... when they try and run it...
    SQL> exec my_proc;
    BEGIN my_proc; END;
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at "SCOTT.MY_PROC", line 4
    ORA-06512: at line 1... oops the code has a bug in it. Our DML statement was invalid.
    This is really something that would have been caught at compile time, if the statement had been a direct DML statement rather than dynamic. And thus we see the problem with people trying to write all their code as dynamic SQL... it's more likely to contain bugs that won't be detected at compile time and only come to light at run time... sometimes only under certain conditions and sometimes once it's got into a production environment. Bad Idea!!!! ;)
    Far better to never create tables (or most other database objects) at run time. Just create them once as part of the database design/implementation and use them as required, allowing you to catch the most common coding errors up front before they get anywhere near a test environment or worse still, a production environment.

  • Character / Input corruption after session lock

    One of our larger customers has the following setup:
    Windows 2008 R2 Active Directory with 2x DC at a datacentre and 1x DC in their head office, 3x RDS servers in a DNS RR terminal server farm and a DC acting as a gateway server.  The end user accesses the RDS infrastructure via an external URL.
    The client PCs are Windows 7 x86 with bare minimum software.  All clients and servers are up to date with released Windows Updates.
    When a user logs into the RDS and leaves their computer, it locks after a certain amount of time.  If they unlock their computer all appears well, but when they unlock the RDS session, they invariably see character corruption which means the password
    is incorrect and they are unable to log in.
    There is a workround by users pressing ESC a few times or disconnecting and reconnecting, however a proper resolve to this issue is requested.
    Any ideas what is causing this and how I can go about troubleshooting?

    Hi,
    Thank you for posting in Windows Server Forum.
    Did you receive any specific error for your case?
    Are you passing your RD Web Server through RD Gateway?
    Does this issue occurs for all users or specific user?
    There is one Hotfix for slightly different scenario if you are passing your server through RD Gateway. Please install if it applicable and check the result.
    The Remote Desktop Gateway service incorrectly blocks a user account whose name contains localized characters in Windows Server 2008 R2
    http://support.microsoft.com/kb/2578133
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Error re-logging in after session timeout using form-based authentication

    Hello,
    We have a web app configured for form-based authentication. When the session times out, we're redirected to our login page as expected. However, after re-logging in, we are not redirected to the desired page (e.g., /faces/OurMainPage.jspx) but to /afr/page_lev_idle.gif.
    Do we have to do anything special for session timeouts?
    Thanks,
    Rico

    Some extra information that might help:
    After re-logging in and we're in /afr/page_lev_idle.gif, we hit the browser Back button (showing the login page again) and then hit the browser Refresh/Reload button and voila we're at the page we expect to be.
    Rico

  • Data not updated in business entity after change in architectural object

    Hi,
    A business entity was created from Architectural Object.
    When we modify the address in the architectural object, the data is not updated in the business entity.
    Is there any solution that make an automatic update for the address in business entity after a change in architectural object ?
    Thx for your help.
    Regards
    Saad

    Hi,
    I have created new infopackage and ran. Now the following message I have got on the monitor.
    "Data not received in PSA Table
    Diagnosis
    Data has not been updated in PSA Table . The request is probably still running or there was a short dump.
    Procedure
    In the short dump overview in BW, look for the short dump that belongs to your data request. Make sure the correct date and time are specified in the selection screen.
    You can use the wizard to get to the short dump list, or follow the menu path "Environment -> Short dump -> In Data Warehouse".
    Removing errors
    Follow the instructions in the short dump."
    Any more thoughts?
    Thanks,
    Rao.

  • CF11 : cflogin doesn't "stuck" after session/login timeout

    Hi,
    Since migrating from CFMX7 to CF11 we are experiencing some weird failure with cflogin (using session or cookie storage).
    Basically when we log-in on the application after a session/client timeout the first login doesn't last for longer than the login submit request.
    The second login however is OK
    I made a very simple application.cfc/index.cfm with short timeouts to check this:
    <cfcomponent
    output="false"
    hint="I define the application settings and event handlers.">
            <!--- Define the application settings. --->
            <cfset this.name = hash( getCurrentTemplatePath() ) />
            <cfset this.applicationTimeout = createTimeSpan( 0, 0, 10, 0 ) />
            <cfset this.sessionTimeout = createTimeSpan( 0, 0, 0, 10 ) />
            <!--- Set up the application. --->
            <cfset THIS.SessionManagement = true />
            <cfset THIS.ClientManagement = true />
            <cfset THIS.SetClientCookies = true />
            <cfset THIS.loginStorage = "Session" />
            <cfset THIS.clientStorage = "sidys" />
            <!--- Define the request settings. --->
            <cfsetting showdebugoutput="false" />
            <cffunction
                    name="OnRequestStart"
                    access="public"
                    returntype="boolean"
                    output="true"
                    hint="Fires at first part of page processing.">
                    <!--- Define arguments. --->
                    <cfargument
                    name="TargetPage"
                    type="string"
                    required="true"
                    />
                    <cfset SetLocale("fr_FR") />
                    <cfif IsDefined("Form.logout") or IsDefined("URL.logout")>
                            <cflogout />
                    </cfif>
                    <cflogin idletimeout="20">
                            <cfdump var="#Session#">
                            <cfinclude template="form.inc" />
    <cfif not isDefined("cflogin") or (cflogin.name IS "" OR cflogin.password IS "")>
            <cfoutput>
                    <form method="post">
                    <b>login :</b>
                    <input type="text" name="j_username" size="24" class="champ" />
                    <b>passwordnbsp;:</b>
                    <input type="password" name="j_password" size="15" class="champ" />
                    <input type="submit" value="Login" class="button" name="submit" />
                    </form>
            </cfoutput>
            <cfabort>
    <cfelse>
            <cflock timeout="10" scope="Session" type="exclusive">
                    <cfloginuser name="#cflogin.name#" Password="#cflogin.password#" roles="role">
                    <cfset Session.id=cflogin.name />
            </cflock>
    </cfif>
                    </cflogin>
                    <cfdump var="#Session#">
                    <cfif GetAuthUser() NEQ "">
                            <cfoutput>
                                    <form method="Post">
                                    <input type="submit" Name="Logout" value="Logout">
                                    </form>
                            </cfoutput>
                    </cfif>
                     <cfreturn true />
            </cffunction>
    </cfcomponent>

    I created a directory and copied your code to it. The exception was that I set THIS.ClientManagement to false and commented out the lines <cfset THIS.clientStorage = "sidys" /> and <cfinclude template="form.inc" />.
    The code worked as expected. The files I used in the test are shown below.
    index.cfm
    We are in index.cfm<br>
    <cfdump var="#session#">
    Application.cfc
    <cfcomponent>
    <!--- Define the application settings. --->
    <cfset this.name = hash(getCurrentTemplatePath()) />
    <cfset this.applicationTimeout = createTimeSpan( 1, 0, 0, 0 ) />
    <cfset this.sessionTimeout = createTimeSpan( 0, 0, 0, 10 ) />
    <!--- Set up the application. --->
    <cfset THIS.SessionManagement = true />
    <cfset THIS.ClientManagement = false />
    <cfset THIS.SetClientCookies = true />
    <cfset THIS.loginStorage = "Session" />
    <!--- <cfset THIS.clientStorage = "sidys" /> --->
    <!--- Define the request settings. --->
    <cfsetting showdebugoutput="false" />
    <cffunction
                    name="OnRequestStart"
                    access="public"
                    returntype="boolean"
                    output="true"
                    hint="Fires at first part of page processing.">
                    <!--- Define arguments. --->
                    <cfargument
                    name="TargetPage"
                    type="string"
                    required="true"
                    />
                    <cfset SetLocale("fr_FR") />
                    <cfif IsDefined("Form.logout") or IsDefined("URL.logout")>
                            <cflogout />
                    </cfif>
                       <cflogin idletimeout="10">
                      <!--- <cfinclude template="form.inc" /> --->
                       <cfif isDefined("cflogin.name") AND cflogin.name IS NOT "" AND cflogin.password IS NOT "">
                             <!--- login form submitted, with username and password filled in --->
                             <cfloginuser name="#cflogin.name#" Password="#cflogin.password#" roles="role">
                             <cfset Session.id=cflogin.name />
                      <cfelseif getAuthUser() IS "">
                              <!--- User not yet logged in --->
                              <cfinclude template="loginForm.cfm">
                              <cfabort>
                     </cfif>
                    </cflogin>
            <cfif getAuthUser() NEQ "">
                <cfinclude template="logoutForm.cfm">
                <!--- <cfabort> --->
            </cfif>
        <cfreturn true />
        </cffunction>
    </cfcomponent>
    loginform.cfm
    <div>
    <form method="post">
    <b>login :</b>
    <input type="text" name="j_username" size="24" class="champ" />
    <b>password :</b>
    <input type="password" name="j_password" size="15" class="champ" />
    <input type="submit" value="Login" class="button" name="submit" />
    </form>
    </div>
    logoutform.cfm
    <div>
    <form method="Post">
    <input type="submit" Name="Logout" value="Logout">
    </form>
    </div>
    You will observe that, like you, I set the session and cflogin timeout to a low test value, 10 seconds. When I first opened the URL to index.cfm in the browser, the login form was duly displayed. I entered a name and password and submitted the form.
    I got the index.cfm page again. That time it had the logout button and a dump of the session scope. The dump contained an id (my username), confirming that login was still active. When I re-requested index.cfm, repeatedly in the browser, within around 4 or 5 seconds, its contents remained unchanged.  I then waited for about 15 to 20 seconds, for the login and session to time out.
    I then repeated the procedure of logging in and re-requesting index.cfm every 4 or 5 seconds. I got the same result: its contents remained unchanged. That is the expected behaviour of cflogin and session.

  • Server Intelligence Agent won't start after repair of Business Objects 4.0

    I migrated our company's business objects contents and documents from previous BO 3.1 server to new BI 4.0  server using standard BI tools. (That is, using the export wizard in BO 3.1 to create BIAR file and using upgrade management tool to import this biar file to new BI 4.0 server).
    After that, everything looks fine, I can log in to launch pad and can see all the folders, reports, etc have been moved over.
    But Life Cycle Management stopped working. I guess the reason is, when I created the biar file from source 3.1 server, I basically included everything that may include LCM folder as well, and this folder overwrite the LCM folder in BI 4.0 server. In order to fix this issue, I did "repair" of BI platform. After this, the Server Intelligen Agent won't start.
    Tried to log on to cmc, got error message 
    "Error: Server SERVERTest:6400 not found or server may be down (FWM 01003) null"
    Tried to start the Server Intelligence Agent from "services", got message:"windows could not start the server intelligence agent (servertest) from local computer..." Checked the event log, no much useful information.
    Can anyone please give me some ideas? what might have caused this issue? where should I look to? I hope we don't have to go through uninstall/reinstall.
    thanks.

    Hi,
    check the Task Manager if you have running the processes running "SIA.exe" ans "cms.exe"
    Regards
    -Seb.

Maybe you are looking for