Proper Use Of Sessions

Hi everyone,
My fellow developers and I were having a discussion as to the proper use of sessions in a web application built with Servlets. The situation was we were building a method to get search results from a database and we wanted to have the ability to limit the number of results displayed per page.
One method of doing this was to get the entire search result, load that into a hashtable or some other data structure, and put that into a session variable to preserve the hashtable.
The other method was to re-query the database every time the person clicked the 'view next' button and get a new result set every time.
I tend to favor the use of session variables to maintain the ResultSet...as I was taught that database connections are expensive and should be limited. However, according to one of the other developers, storing objects (especially when they are potentially large) in session variables is not recommended.
So what do you guys think? Should be store large objects in session variables, or should we re-query the database every time the person loads the page?
As a side note, the servers we use are quite robust, but we know that that is not an excuse to write in-efficient code.

Its a trade off between memory and database access.
Storing stuff in session is expensive in terms of memory.
The more stuff you store in session, the more overhead there is with each user of the system.
Querying the database each time saves you memory on the app server, but means more work for the database.
Which is better? As always it depends.
- How many users are projected for the system? More users means you want to keep the session as light as possible.
- Is the query is hugely expensive to run? A long running query that only returns a few records - you would want to cache that in session.
- Are you able to limit the result set data returned via the database? Some database support this, some don't. ie if you did a database query each time would you have to step through "5 pages" of data to get to display the "6th" page, or could you just get the data for page 6 using row numbers?
Database connections themselves aren't that expensive to acquire if you are using connection pooling, but they are still a limited resource.
Hope that helps some,
evnafets

Similar Messages

  • Using SSO Session

    Hi,
    We are using AS 10.1.3.5 to deploy our EAR.(platfoem is OEL 5)
    In our EAR we are Hibernate 3.0 and Struts 2.0 Framework,using JDeveloper 10.1.3.5 and also we are using the SessionAware Interface of Struts 2 to implement session management.
    We have configured this as a partner Application with SSO and OID(10.1.4.3) using "Note 403164.1 " and invoking AS 10.1.2 Reports from our EAR.
    So,we need to use the same SSO session throughout our J2EE Application.
    Where as we need to add some session attribute to the SSO session which we are picking from our custom db table and we need to use those session attributes throughout our application (as long as the SSO session is valid).
    We do not have any idea on using this SSO sessions.(before making this a partner application we were using Servlet Sessions)
    Please suggest how to set some attibutes in the SSO session and retireve the same in our EAR.
    Edited by: Susmit on Jun 14, 2011 7:05 PM

    Susmit
    There are 2 ways you will be configuring SSO in OHS of OAS.
    Static and dynamic.
    Which one you are using ?
    If you are using dynamic i.e using java program, you have the control of the flow. You can make entries of that after successful authentication and delete the entries when the session expires.
    You can always check the session status using java api.
    If you are using static, you should have one servlet filter to track the session.
    Regards
    Chinna

  • Unable to filter a recordset using a session  variable

    I have a volunteer application page and when the volunteer presses <Submit> their info is saved in a MySQl db table and a session variable is created containing the primary key of their record in the table, control is then passed to a "success page". The success page can access the session variable (I proved this by displaying the session variable on the success page) so my next step was to create a recordset in the success page with a filter using the session variable to select the appropriate row in the table, allowing me to display to the volunteer the info they submitted.
    I set up a test success page which displays the session variable and one field of the volunteer info. When I test this I see the session variable displayed but the corresponding volunteer info field from the recordset is not displayed.
    The volunteer application page is here www.hollisterairshow.com/volunteerapp.php and the successpage is here www.hollisterairshow.com/thanksvol.php
    The code that creates the session variable in the volunteer application page is shown below
    $_SESSION['volunteer_id'] = mysql_insert_id();
    The code to display the session variable in the success page is shown below
    <?php  echo $_SESSION['volunteer_id']; ?>
    The code to display the volunteer info is shown below
    <h1> Thank You <?php echo $row_rsVolunteerApp['firstname']; ?>!! </h1>
    The recordset definition is shown below
    The success page test result is shown below, as you can see the volunteer's first name is not displayed immediately after the "Thank you" message but the session variable holding the correct primary key (41) is shown correctly.
    Does anyone have an idea of what I'm doing wrong?
    Thanks
    Tony

    Where did you put session_start()? It needs to be before the variable is accessed. It's obviously before the line that displays the value in your page, but is it before the SQL query is generated?
    Also, have you checked in phpMyAdmin to see whether volunteernumber 41 has any values in the database?

  • Java Heap Error when using Stateless Session Timer Bean deployed in Oracle

    Hi,
    Am getting following Java Heap Error when using Stateless Session Timer Bean deployed in Oracle 10g AS R3 (Oracle Containers for J2EE 10g (10.1.3.0.0) (build 060119.1546.05277) ):
    06/08/02 14:58:43 javax.ejb.EJBException: java.lang.OutOfMemoryError: Java heap space
    06/08/02 14:58:43 at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:304)
    06/08/02 14:58:43 at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:67)
    06/08/02 14:58:43 at com.evermind.server.ejb.interceptor.system.TxNotSupportedInterceptor.invoke(TxNotSupportedInterceptor.java:45)
    06/08/02 14:58:43 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
    06/08/02 14:58:43 at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:86)
    06/08/02 14:58:43 at com.evermind.server.ejb.StatelessSessionEJBHome.invokeTimer(StatelessSessionEJBHome.java:71)
    06/08/02 14:58:43 at com.evermind.server.ejb.EJBContainer.invokeTimer(EJBContainer.java:1624)
    06/08/02 14:58:43 at oracle.ias.container.scheduler.TimerTask.runBeanTimer(TimerTask.java:92)
    06/08/02 14:58:43 at oracle.ias.container.scheduler.TimerTask.run(TimerTask.java:184)
    06/08/02 14:58:43 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
    06/08/02 14:58:43 at java.lang.Thread.run(Thread.java:595)
    06/08/02 14:58:43 Caused by: java.lang.OutOfMemoryError: Java heap space
    I had tried using -Xms / -Xmx options (upto 1 GB).
    The trace of exception gets delayed (from being displayed on the console) as the memory size is increased; but after sometime it starts getting displayed on the console.
    Even though this exception is displayed on the console, the Timer Bean continues to execute upto sometime before it finally crashes!
    If anyone has encountered such problem; would appreciate if you could share the solution.
    Regards, Vidyadhar

    Hi guys, I have the same problem. I have an application EAR file with two modules (EJB and WAR starting in this order). The application can schedule a process via EJB timer. In this case restarting the server I receive the error above. If I change the modules start order --> WAR - EJB the server start correctly, but the application scheduler fails (the persistency is not working) with this error:
    07/10/09 10:30:54 FINISSIMO: TimerTask.runBeanTimer java.lang.NullPointerException; nested exception is: java.lang.NullPointerExceptionjavax.ejb.TransactionRolledbackLocalException: java.lang.NullPointerException; nested exception is: java.lang.NullPointerException
    java.lang.NullPointerException
         at java.util.ListResourceBundle.handleGetObject(ListResourceBundle.java:107)
         at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
         at java.util.ResourceBundle.getString(ResourceBundle.java:285)
         at java.util.logging.Formatter.formatMessage(Formatter.java:108)
         at oracle.j2ee.util.TraceLogFormatter.format(TraceLogger.java:124)
         at oracle.j2ee.util.TraceLogger$TraceLoggerHandler.publish(TraceLogger.java:105)
         at java.util.logging.Logger.log(Logger.java:428)
         at java.util.logging.Logger.doLog(Logger.java:450)
         at java.util.logging.Logger.log(Logger.java:539)
         at oracle.ias.container.timer.TimerEntry.readObjFromBytes(TimerEntry.java:308)
         at oracle.ias.container.timer.TimerEntry.getInfo(TimerEntry.java:107)
         at oracle.ias.container.timer.Timer.getInfo(Timer.java:367)
         at oracle.ias.container.timer.EJBTimerImpl.getInfo(EJBTimerImpl.java:89)
         at com.finantix.foundation.integration.ejbtimer.EJBTimerServiceExecutorBean.ejbTimeout(EJBTimerServiceExecutorBean.java:42)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBTimeoutJoinPoint.invoke(EJBTimeoutJoinPoint.java:20)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at com.evermind.server.ejb.StatelessSessionEJBHome.invokeTimer(StatelessSessionEJBHome.java:38)
         at com.evermind.server.ejb.EJBContainer.invokeTimer(EJBContainer.java:1714)
         at oracle.ias.container.scheduler.TimerTask.runBeanTimer(TimerTask.java:106)
         at oracle.ias.container.scheduler.TimerTask.run(TimerTask.java:220)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    javax.ejb.TransactionRolledbackLocalException: java.lang.NullPointerException; nested exception is: java.lang.NullPointerException
         at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:309)
         at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:73)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:55)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at com.evermind.server.ejb.StatelessSessionEJBHome.invokeTimer(StatelessSessionEJBHome.java:38)
         at com.evermind.server.ejb.EJBContainer.invokeTimer(EJBContainer.java:1714)
         at oracle.ias.container.scheduler.TimerTask.runBeanTimer(TimerTask.java:106)
         at oracle.ias.container.scheduler.TimerTask.run(TimerTask.java:220)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.NullPointerException
         at java.util.ListResourceBundle.handleGetObject(ListResourceBundle.java:107)
         at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
         at java.util.ResourceBundle.getString(ResourceBundle.java:285)
         at java.util.logging.Formatter.formatMessage(Formatter.java:108)
         at oracle.j2ee.util.TraceLogFormatter.format(TraceLogger.java:124)
         at oracle.j2ee.util.TraceLogger$TraceLoggerHandler.publish(TraceLogger.java:105)
         at java.util.logging.Logger.log(Logger.java:428)
         at java.util.logging.Logger.doLog(Logger.java:450)
         at java.util.logging.Logger.log(Logger.java:539)
         at oracle.ias.container.timer.TimerEntry.readObjFromBytes(TimerEntry.java:308)
         at oracle.ias.container.timer.TimerEntry.getInfo(TimerEntry.java:107)
         at oracle.ias.container.timer.Timer.getInfo(Timer.java:367)
         at oracle.ias.container.timer.EJBTimerImpl.getInfo(EJBTimerImpl.java:89)
         at com.finantix.foundation.integration.ejbtimer.EJBTimerServiceExecutorBean.ejbTimeout(EJBTimerServiceExecutorBean.java:42)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBTimeoutJoinPoint.invoke(EJBTimeoutJoinPoint.java:20)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         ... 9 more
    Any idea?
    Thx Auro

  • Creation of Material using BDC Session method & global class

    Hi
    Creation of Material using BDC Session method & global class by using oops.
    can anyone plz help me out

    Hi,
    it looks like it's not possible to call this BAPI wihtout material number. Here is a quote from BAPI documentation.
    When creating material master data, you must transfer the material
    number, the material type, and the industry sector to the method. You
    must also enter a material description and its language.
    Cheers

  • Creating Sales order texts while using BDC session method is not working

    Hi All,
    I have an existing program which creates sales order using BDC session method.( Actual program uses BAPI to create sales order and in case if any error occurs during creation of sales order BDC session is generated so that user can process it later and i am facing issues in this part of code where it uses BDC)
    I wanted to modify this BDC sesion  to update the sales order text also. I tried recording VA01 for creationg sales order text unfortunatly it is not capturing the data i am entering in the text fields.
    Please suggest if there is any way to create sales order using BDC.
    Regards
    Sheeba

    Hi Madhu,
    '=TP_CREATE' is the OK code i am getting for creating TEXTS. But the text entered are not captured in BDC.
    Part of BDC program generated for cretaing sales order texts.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=%_GC 128 22'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=TP_CREATE'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4003'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBACK'.
    perform bdc_field       using 'LV70T-SPRAS'
                                  'EN'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    Regards,
    Sheeba

  • Use transacted session in MDB

              Hi,
              If I use transacted session in MDB with container managed transaction, dose the
              weblogic ignore the transacted setting or start in it's own transaction. I looked
              the JMS Tutorial from Sun, the J2EE server just ignore the transacted setting,
              treated it as non-transacted session.
              Thanks
              

              Thanks, Greg. I created another XAQCF in MQ JMSADMIN, but still did not help. The
              strange part is when this exception happens, in the Event Viewer there is a Message:
              An internal Websphere MQ Error has occurred'. In the Trace Log of MQ, the Major
              Error Code reported is arcE_XAER_PROTO.
              Has anyone encountered this error? The same code works fine when enlist an XAQCF
              defined in Weblogic and PUT into a Weblogic JMS Queue instead within the same
              XA Transaction. I am attaching the stack trace to this message, just in case,
              someone has useful pointers to help me. May be this is MQ Specific though I made
              sure I have the latest FixPack for MQ installed.
              Thanks,
              Sridhar
              "Greg Brail" <[email protected]> wrote:
              >Yeah. This comes up from time to time. MQ is upset because it wants to
              >be
              >enlisted in the JTA transaction, but JTA is not enlisting it because
              >it
              >thinks it's already enlisted. It thinks it's already enlisted because
              >the
              >same MQ connection factory was used for the MDB input queue, even though
              >it's a different JMS connection and session.
              >
              >You can avoid this by creating another "XAQCF" object in the MQ JNDI
              >space
              >and giving it a different name. If you do that -- essentially use different
              >connection factories for the MDB's input and output queues -- then this
              >will
              >work.
              >
              >Also, the transaction enlistement code in 8.1 that supports the
              >"resource-ref" feature avoids this problem.
              >
              > greg
              >
              >"Sridhar Krishnaswamy" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Hi Greg:
              >> I assume you meant to getXAResource() from an Object of type
              >XAQueueSession. Here
              >> is the code I tried within the onMessage() method of the MDB:
              >>
              >> XAQueueConnectionFactory factory = (XAQueueConnectionFactory)
              >ctx.lookup("XAQCF")
              >> ;
              >> XAConnection connection = factory.createXAQueueConnection() ;
              >>
              >> XAQueueSession mqSession = connection.createXAQueueSession() ;
              >> XAResource mqResource = mqSession.getXAResource() ;
              >> Transaction tran = TxHelper.getTransaction() ;
              >> tran.enlist(mqResource) ;
              >>
              >> //Then I was going to get the QueueSession Object from XAQueueSession,
              >obtain
              >> the Queue
              >> //Object from JNDI, create the Sender
              >> //and call the send. But I commented out these calls. Even then, after
              >the
              >onMessage
              >> Method
              >> // completes, I get the following error:
              >>
              >> javax.transaction.SystemException: start() failed on resource
              >'com.ibm.mq.MQXAResource':
              >> XAER_PROT : Routine was invoked in an improper context
              >> javax.transaction.xa.XAException: XA Operation failed. see errorcode
              >(which I
              >> am assuming is XAER_PROT).
              >>
              >> Any idea, what I am doing wrong?
              >>
              >>
              >>
              >>
              >> "Greg Brail" <[email protected]> wrote:
              >> >In 7.0, you can do your MQ "put" inside the same JTA transaction that
              >> >was
              >> >used to receive the message for the MDB, but you have to do the
              >transaction
              >> >enlistment yourself. Basically, you have to use the class
              >> >weblogic.transaction.TxHelper class to get a reference to the current
              >> >transaction, then call "enlistResource" on the transaction using the
              >> >JTA
              >> >"XAResource" that you get from the MQ JMS "Session" object. I'm sure
              >> >we've
              >> >posted the code in this newsgroup before, but I don't know where,
              >so
              >> >it
              >> >would look something like:
              >> >
              >> >// First, get the MQ QueueSession object you're going to use to send
              >> >the
              >> >message
              >> >QueueSession mqSession = mqConnection.createQueueSession(false, 0);
              >> >XAResource mqResource = mqSession.getXAResource();
              >> >weblogic.transaction.Transaction tran =
              >> >weblogic.transaction.TxHelper.getTransaction();
              >> >tran.enlistResource(mqResource);
              >> >// Now send your message
              >> >
              >> >In 8.1, this will still work, but it's not necessary. If you register
              >> >the MQ
              >> >XA connection factory as a "resource-reference" in your EJB deployment
              >> >descriptors and look it up using java:comp/env the way the documentation
              >> >link way below describes, then this transaction enlistment happens
              >> >automatically. This only happens when you use the "resource-reference"
              >> >feature (which means that old code will still work if it does NOT
              >use
              >> >this
              >> >feature), and it's only in 8.1.
              >> >
              >> > greg
              >> >
              >> >"Sridhar Krishnaswamy" <[email protected]> wrote in
              >message
              >> >news:[email protected]...
              >> >>
              >> >> Hi Greg:
              >> >> Is the Statement
              >> >>
              >> >> 'But in this case, you don't get a "non-transactional" session,
              >but
              >> >actually a
              >> >> session that participates in the current JTA transaction for the
              >thread
              >> >where
              >> >> your EJB is running'
              >> >>
              >> >> also true in the case of an MDB running in Weblogic 7.0 (Container
              >> >Managed
              >> >Transactions)
              >> >> driven by an XAQCF and a Foreign JMS Provider such as MQSeries?
              >In
              >> >other
              >> >words,
              >> >> if I want the MDB to PUT the Message into an MQSeries Queue, can
              >the
              >> >PUT
              >> >be invoked
              >> >> under the Context of the Same XA Transaction? My understanding is
              >that
              >> >WebLogic
              >> >> 7.0 doesn't support send
              >> >> messages out of an MDB within the same XA transaction if the MDB
              >is
              >> >> XA-driven by a foreign JMS provider. Please let me know if this
              >is
              >> >false.
              >> >If true,
              >> >> does Weblogic 8.1 also have this restriction?
              >> >>
              >> >> Thanks,
              >> >> Sridhar Krishnaswamy.
              >> >>
              >> >> "Greg Brail" <[email protected]> wrote:
              >> >> >What do you mean by "use transacted session in MDB?" Are you creating
              >> >> >a new
              >> >> >session inside your MDB, or do you mean something else?
              >> >> >
              >> >> >The only Sun thing I can think of is in code that looks like this:
              >> >> >
              >> >> >InitialContext ctx = new InitialContext();
              >> >> >QueueConnectionFactory qcf = ctx.lookup("java:comp/env/jms/QCF");
              >> >> >Queue queue = ctx.lookup("java:comp/env/jms/Queue");
              >> >> >QueueConnection connection = qcf.createQueueConnection();
              >> >> >// Create "transacted" session:
              >> >> >QueueSession session = connection.createQueueSession(true, 0);
              >> >> >QueueSender sender = session.createQueueSender(queue);
              >> >> >TextMessage message = session.createTextMessage("Hello, world");
              >> >> >sender.send(message);
              >> >> >connection.close();
              >> >> >
              >> >> >If you do this, and exactly this, inside an EJB, including the
              >use
              >> >of
              >> >> >"java:comp/env/jms", in WebLogic Server 8.1, then we do indeed
              >ignore
              >> >> >the
              >> >> >"transacted" flag when you create the session, just like Sun says
              >> >we
              >> >> >should
              >> >> >in the EJB and J2EE specs. But in this case, you don't get a
              >> >> >"non-transactional" session, but actually a session that participates
              >> >> >in the
              >> >> >current JTA transaction for the thread where your EJB is running.
              >> >> >
              >> >> >The idea is that if you are working inside an EJB, you don't use
              >> >transacted
              >> >> >sessions -- you use the transaction control given to you by the
              >EJB
              >> >> >container, including the UserTransaction interface and/or the various
              >> >> >container-managed transaction flags, rather than the JMS "transacted
              >> >> >session".
              >> >> >
              >> >> >You can find more information here:
              >> >> >
              >> >> >http://e-docs.bea.com/wls/docs81/jms/j2ee_components.html
              >> >> >
              >> >> > greg
              >> >> >
              >> >> >"Jen" <[email protected]> wrote in message
              >> >> >news:[email protected]...
              >> >> >>
              >> >> >> Hi,
              >> >> >>
              >> >> >> If I use transacted session in MDB with container managed
              >transaction,
              >> >> >dose the
              >> >> >> weblogic ignore the transacted setting or start in it's own
              >> >transaction.
              >> >> >I
              >> >> >looked
              >> >> >> the JMS Tutorial from Sun, the J2EE server just ignore the
              >transacted
              >> >> >setting,
              >> >> >> treated it as non-transacted session.
              >> >> >> Thanks
              >> >> >
              >> >> >
              >> >>
              >> >
              >> >
              >>
              >
              >
              [eRRORS.txt]
              

  • Facing issue with concurrent use of session

    Hi All,
       We are facing concurrent use of session.save call in our LDAP sycn up process. Issue we got while performing performance test for multiple user and issue is at com.day.crx.security.ldap.LDAPUserSync.performUpdate api. Please guide me what could be wrong missing in code due to this Out of box service is showing error.
    Below are logs:
    02.01.2013 14:32:07 WARN SessionState: Attempt to perform session.save() while another thread is concurrently writing to session-system-1. Blocking until the other thread is finished using this session. Please review your code to avoid concurrent use of a session. (SessionState.java, line 149)
    java.lang.Exception: Stack trace of concurrent access to session-system-1
    at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:147)
    at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:355)
    at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:758)
    at com.day.crx.security.ldap.LDAPUserSync.performUpdate(LDAPUserSync.java:230)
    at com.day.crx.security.ldap.LDAPUserSync.syncUser(LDAPUserSync.java:178)
    at com.day.crx.security.ldap.LDAPLoginModule.commit(LDAPLoginModule.java:266)
    at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
    Regards,
    Yogesh

    Hey Jorg,
    Your comments are much appreicated!
    question about the statement "it seems, that you import lot of users concurrently from the LDAP".  for us yes we are but the question is should that me problamatic?  We do see that it is causing issues for us  in CQ5.5 with CRX 2.3.15:
    com.day.crx.security.ldap.LDAPLoginModule commit: could not commit: javax.jcr.InvalidItemStateException: property /some/LDAP/group/rep:lastsynced: the property cannot be saved because it has been modified externally.
    However we had no such issue with CQ5.3 with CRX2.0
    -Faraz

  • Unable to Serialize ReportClientDocument using "StateServer" session mode

    Hello,
    In my ASP.NET application, I am using "StateServer" session state mode for maintaining session variables. The problem however is that this mode requires all the objects inside the session variables to be serialized and for some reason ReportClientDocument doesn't seem to be serializable.
    Here is the code that's not working:
    ceSession = Session.Item("ceSession")
    ceEnterpriseService = ceSession.GetService("", "InfoStore")
    ceInfoStore = New InfoStore(ceEnterpriseService)
    rptAppFactory = ceInfoStore.EnterpriseSession.Interface.Service("", "RASReportFactory")
    rptClientDoc = rptAppFactory.OpenDocument(rptId, CdReportClientDocumentOpenOptionsEnum.cdReportClientDocumentOpenAsReadOnly)
    Session.Add(rptClientDoc)
    At the end of the request it throws an exception
    "Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode."
    [SerializationException: Type 'CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass' in Assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' is not marked as serializable.]
    Is anybody having any idea on how to successfully store ReportClientDocument in the session variable by using "StateServer" session state mode?
    Thanks

    There is a sample that demonstrates serializing the ReportClientDocument [here|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0a4791b-9d3b-2c10-94a5-86088b6224d4]

  • Using ALTER SESSION inside a stored procedure.... not a good idea?

    Hi,
    I have two stored procedures, both of which are used to query a database to find a particular book, based on ISBN. One sproc searches our main product catalogue and the other searches our suppliers feed catalogues. The stored procedures are called from a C# application via a search tool and the user is able to search on either our catalogue or our suppliers. The appropriate procedure is called based on the users choices.
    However, the following behaviour is observed
    I search for an ISBN (is a varchar2 field, as isbn's may contain an X if the checksum digit equates to 10) on a feed, so uses the FEED SPROC. The book is found and returned to the app in about 0.5 seconds. I can repeat this as often as i like on different books etc. always works fine.
    I then do the same search but against our own catalogue, so uses our CATALOGUE SPROC. Again the book is found quickly, and the search can be repeated with the same results.
    If i then go back and run our FEED SPROC then the search time increases to about 3 minutes !
    Both the feed and our catalogue is in the same database, although different schema's the connections will be pooled through our app server.
    I can repliacte this every single time. I think i have narrowed doen the cause of this behaviour to a few lines of code in our CATALOGUE SPROC:
    -- store values
    select value into v_vch_NLS_COMP from nls_session_parameters nsp where nsp.parameter = 'NLS_COMP';
    select value into v_vch_NLS_SORT from nls_session_parameters nsp where nsp.parameter = 'NLS_SORT';
    -- Ensure case insensitivity throughout
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = LINGUISTIC';
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = BINARY_CI';
    do other stuff
    -- restore session variables
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = ' || v_vch_NLS_COMP;
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = ' || v_vch_NLS_SORT;
    If i remove this code then all is well, so i am assuming that using ALTER SESSION inside a stored procedure is the cause of the problem as it would be changing the execution plan of the FEEDS SPROC in some manner? Any ideas? I know i can just rewrite the sproc to avoid using this coding, but wanted to understand if i am doing something wrong by using ALTER SESSION in this manner?
    Any pointers would be appreciated.
    John Thompson
    Software Architect,
    play.com
    Edited by: user7186902 on 27-May-2009 03:51

    Hello (and welcome),
    It may be a case of having to create a linguistic index to facilitate the queries once you set these session level parameters, i.e..,
    CREATE INDEX idx_01 ON tab ((NLSSORT(col1, 'NLS_SORT=BINARY_CI'))It would appear that the setting of those parameters is invalidating index searching on the current indexes.

  • Use of Session Variable in Dashboard Page XML

    Hi All,
    Can we use a Session variable in the Dashboard Page XML?
    My Requirement is,
    There are 1000+ users, each user will have access to same dashboard. But a different report in the same dashboard.
    So we want to Save individual user reports in the location /users/LOGIN_NAME/Financials/ABC
    and dynamically change the Dashboard Page XML, to accept Session Variable VALUEOF(NQ_SESSION.USER) in place of LOGIN_NAME.
    So that for each user, they will see only their report.

    On the face of it, Session is ideal for this, however this is SharePoint and the obvious isn't always the best. 
    You'd need to do the calculation about memory usage and number of concurrent users to ensure it really is a viable option in Production. 
    If it isn't viable, or wouldn't scale to possible future usage what would you do? Then you need to ask if it's really necessary to move between pages? If the user needs to move through a dialog for example, that could be hosted on a single page which might
    have different controls or sections made visible as the user progressed through the use case.
    Passing data between pages in SharePoint is a lot more difficult than it should be. Sometimes it's best to stay put, and certainly safer than using Session if you're really not sure if Session will stop your solution from scaling.
    Always remember, SharePoint might be hosted on ASP.NET but the design considerations are significantly different than if this were a pure ASP.NET application.
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • Proper use of END-OF-SELECTION event in report programme

    Hi,
    If we will write "WRITE" statements in side START-OF-SELECTION then it will help me to display the output.Then what is the need of END-OF-SELECTION .
    Can any body please tell me the <b>proper use of END-OF-SELECTION event in report programme.</b>

    This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started.
    <b>In report programs using LDB for every value selected the program issues the output, to control this you would use END-OF-SELECTION.</b> Now if you call your output in this event, the output is made only after all the values are selected as per the selection criteria.
    suppose while coding, u need a logic like below:
    if a condition is satisfied continue with the report
    and if not satisfied, then display a message and end the report.
    then u can code like below.
    start-of-slection.
    if a = <condition>.
    do the following.......
    else.
    stop.
    end-of-selection.
    write: 'THIS IS END'.
    stop command triggers end-of-slection from anywhere.
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Problem in using XSQL-Session

    We want to use Session information in our application. How do I use XSQL-SEt-Session-param ? Do I have to create another servlet to manage session and call the XSQLServlet from that session servlet or can I use XSQL-session elements ?
    Please help on this.

    <xsql:set-session-param> sets a session-level parameter to a value
    To refer to the session-level parameter value, just refer to its name as a parameter.
    No extra servlets needed.

  • OBIEE | Using Dynamic Session Variable in Physical Layer

    Hi All,
    Any idea if we can use Dynamic Session Variables (I think they are also called Repository Variables) in our physical layer. I basically need to set the value of this variable from dashboard when a link is clicked, and then use this in my SELECT query at physical layer so that OBIEE does not pull all the data from the database tables.
    Regards
    Adeel Javed
    Edited by: user10642426 on Apr 6, 2009 2:03 AM

    Christian,
    Thanks for the quick response, ok we have actually moved to a different solution now, we are actually using Direct Database Request because one of our reports is supposed to be accessing direct transactional system i.e. for this report we are using OBIEE as a reporting tool. We are able to do that and even create links between different reports i.e. based on prompt in Report A filter Report B, but the scenario now is that we need to set a presentation variable from Report A when a navigation link gets clicked, because so far according to our knowledge direct SQL only allows presentation variables in its WHERE clause. So, any ideas how can we set a presentation variable when a navigation link is clicked. Thanks.
    Regards
    Adeel Javed
    Edited by: adeeljaved on Apr 6, 2009 11:43 PM

  • Standard for the use of session variable in webpart code.

    Hi,
    Why we should avoid using of session variables while writing code?
    Is it not a standard?
    Thanks,
    Akhilesh Rao
    Akhilesh Rao

    On the face of it, Session is ideal for this, however this is SharePoint and the obvious isn't always the best. 
    You'd need to do the calculation about memory usage and number of concurrent users to ensure it really is a viable option in Production. 
    If it isn't viable, or wouldn't scale to possible future usage what would you do? Then you need to ask if it's really necessary to move between pages? If the user needs to move through a dialog for example, that could be hosted on a single page which might
    have different controls or sections made visible as the user progressed through the use case.
    Passing data between pages in SharePoint is a lot more difficult than it should be. Sometimes it's best to stay put, and certainly safer than using Session if you're really not sure if Session will stop your solution from scaling.
    Always remember, SharePoint might be hosted on ASP.NET but the design considerations are significantly different than if this were a pure ASP.NET application.
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

Maybe you are looking for

  • IMessage on MacBook Pro - how to use mobile number?

    So I upgraded to 10.8.2 on ML and IOS 6 on other devices. I notice on the iPhone that my iMessages can be received by default only to the mobile number. I previously turned iMessage off because frankly it was a complete PITA and more trouble than it

  • PO for delivery

    how to get PO number for a particular delivery ..tried using VBFA but could not find

  • Looking for Intro to Oracle Project Documentation

    We are installing the Project Management module, and I have been unable to locate any general intro documentation. Anyone know if there IS any?

  • Sort a playlist in a special order

    Hello, is ther a way to sort a playlist in the following order: First: Artist (ascending) Second: Title (ascending) Third: Duration (Decending) How can i achive that ? Thanks Matthias

  • Procedure account key and accrual

    Dear all, 1 What is the difference for account key and accrual in procedure M/08. 2 I maintain both FR1 at account key and FR3 at accrual. During GR, I only see gl account for FR3 showing. Why not FR1 at account key? 3 I see most of the condition wit