Getting Static Data in Footer

Hi all,
I have a PO report where I have to print Total Sum(which is coming from a tag at header level) of each PO lines in footer. For this I have used template and call that template in the footer section as suggested by Paul.Now the problem is the Total Sum column in the footer is holding a static value for each PO which is the Total of the last PO in the loop.But I have defined the template within the for loop of the PO loop.Can anybody kindly help ?
Thanks in advance
Sanjay

Then maybe something like this?
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Date;
public class RunnableWithPreviousState implements Runnable {
    private static class State {
     public Date startTime, endTime;
     public State() {
         startTime = new Date();
    private static List<RunnableWithPreviousState> runnables = Collections
         .synchronizedList(new ArrayList<RunnableWithPreviousState>());
    private State previousState, myState;
    @Override
    public void run() {
     myState = new State();
     runnables.add(this);
     int index = runnables.indexOf(this);
     if (index > 0) {
         index -= 1;
         previousState = runnables.get(index).myState;
     if (previousState != null) {
         // inspect previousState
     // do other processing
     myState.endTime = new Date();
}Piet

Similar Messages

  • Problem Using HTTP Dispatcher -- Could Not able to get the data in JSP

    Hi, I am using HTTP Dispatcher to send my events to particular URL which is a JSP page. I am trying to populate the received event through URL and populate to a oracle data base. But could not able to get the data in Oracle database.
    Code is :
    <h1>JSP Page</h1>
    <%
    long type = 0;
    String tagId = null;
    String timeStr = "0";
    String deviceName = "";
    // Get Event Parameters
    // Available Parameters: id, siteName, deviceName, data, time, type, subtype, sourceName, correlationId
    try
    type = Long.parseLong(request.getParameter("type")); // Get type
    tagId = request.getParameter("id"); // Get tagId
    timeStr = request.getParameter("time"); // Get time
              deviceName = request.getParameter("deviceName");
    catch (Exception e)
    out.println( "Error: "+e.getMessage() );
              // Write into DB.
              try {
              if ((tagId == null) || (type != 200) ){
                   // Do Nothing
                   //return;
              } else {
                   OracleDataSource ods = new OracleDataSource();
                   String URL = "jdbc:oracle:thin:@//3.235.173.16:1525/vislocal";     
                   ods.setURL(URL);
                   ods.setUser("cus");
                   ods.setPassword("cus");
                   Connection myConn = ods.getConnection();     
                   Statement stmt = myConn.createStatement();
                   String selectQuery =
                             "SELECT MAX(rfid_raw_reads_id) as max_id FROM "+
                        "cus.rfid_raw_reads ";
                   ResultSet rs = stmt.executeQuery(selectQuery);
                   String maxId = "1";
                   if (rs.next()) {
                        maxId = rs.getString(1);               
                   String selectMaxTagIDQuery =
                             "SELECT MAX(rfid_raw_reads_id) as max_id FROM "+
                        "cus.rfid_raw_reads WHERE tag_id = '" + tagId + "'" ;
                   stmt = myConn.createStatement();
                   rs = stmt.executeQuery(selectMaxTagIDQuery);
                   String maxTagId = "1";
                   if (rs.next()) {
                        maxTagId = rs.getString(1);               
                   long primaryKey = 1;
                   long tagKey = 1;
                   try {
                        primaryKey = Long.parseLong(maxId) + 1;
                        tagKey = Long.parseLong(maxTagId) + 1;
                   } catch (Exception e) {
                   long currentTime = System.currentTimeMillis();
                   long updateKey = (tagKey - 1);
                   String updateQuery = " UPDATE cus.rfid_raw_reads SET read_end_time = " + currentTime + " WHERE rfid_raw_reads_id = " + updateKey;
                   Statement updateStmt = myConn.createStatement();
                   updateStmt.execute(updateQuery);     
                   String query =
                        "INSERT INTO cus.rfid_raw_reads (rfid_raw_reads_id, tag_id,device_name,read_start_time) VALUES ("+ primaryKey + ",'" + tagId + "'," + deviceName + "'," + System.currentTimeMillis() + " )" ;
                   Statement insertStmt = myConn.createStatement();
                   insertStmt.execute(query);     
                   myConn.commit();
                   myConn.close();
              } catch (Exception e) {
    %>
    <p>For browser debug:
    <%
    out.println( "Type="+type+" ID="+tagId +" time="+timeStr );
    %>
    Kindly suggest where is the problem...
    Thanks and regards
    Mohammad Nasim Akhtar

    HI Prabhat,
    Thanx for your reply, I worked out and able to receive the data in oracle database, Actually there was some problem in insert Query. Now I have tested the same... and able to edit the same in the Database.....
    But I am facing a new problem, Http Dispatcher in SES console is displaying all the Events generated as well as event in Que but there is no events in the Event Send. I guess it is not able to send the events.....?????
    Event statical is showing like this
    Events Received: 0 (0.00/sec)
    Events Generated: 311 (0.19/sec)
    Events Sent: 2 (0.19/sec)
    Queued Events: 309 (0.19/sec)
    Kindly suggest where is the problem, Is it a JSP problem or OSES end problem.....
    Thanks and regards
    Nasim

  • Problem getting correct data from MS Access after doing an Update

    Hi all,
    I have a problem getting correct data after doing an update. This is the scenario
    I am selecting some(Eg: All records where Column X = �7� ) records and update a column with a particular value (SET Column X = �c� ) in all these records by going through a while loop. In the while loop I add these records to a vector too, and pass it as the return value.
    After getting this return value I go through a for loop and get each record one by one from the DB and check if my previous update has actually happened. Since No errors were caught while updating DB, I assume all records are updated properly but my record set shows one after another as if it has not been updated. But if I open the DB it is actually updated.
    This does not happen to all records, always it shows like this
    1st record     Mode = �c�
    2nd record     Mode = �7�
    3st record     Mode = �c�
    4nd record     Mode = �7�
    9th record     Mode = �c�
    10th record     Mode = �7�
    I am relatively new to java and this is someone elses code that I have to modify,So I am not sure if there some thing wrong in the code too
    //Here is the method that gets records and call to update and add to vector
    public static Vector getCanceledWorkOrders() throws CSDDBException{
    //Variable declaration
      try {
        objDBConn = DBHandler.getCSDBCon();
        strSQL  = "SELECT bal bla WHERE [Detailed Mode])=?)";
        objStmt = objDBConn.prepareStatement(strSQL);   
        objStmt.setString(1, '7');
        objWOPRs = objStmt.executeQuery();
        while (objWOPRs.next()) {
         //Add elements to a vector by getting from result set
          //updating each record as PROCESSING_CANCELLED_WO(c)
          iRetVal = WorkOrderDetailingPolicy.updateRecordStatus(objPWODP.iWorkOrderNumber, objPWODP.strPersonInformed, EMSConstants.PROCESSING_CANCELLED_WO);
          if (iRetVal == -1) {
            throw new NewException("Updating failed");
      catch (Exception e) {
        vecWONumbers = null;
        throw new CSDDBException(e.getMessage());
      }finally{
        try {
          objWOPRs.close();
          objStmt.close();
          DBHandler.releaseCSDBCon(objDBConn);
        catch (Exception ex) {}
      //return vector
    //here is the code that actually updates the records
    public static int updateRecordStatus(int iWONumber, String strPerInformed , String strStatus) throws CSDDBException{
       PreparedStatement objStmt = null;
       Connection objDBConn  = null;
       String strSQL = null;
       int iRetVal = -1;
       try{
         objDBConn  = DBHandler.getCSDBCon();
         objDBConn.setAutoCommit(false);
         strSQL = "UPDATE Table SET [Detailed Mode] = ? WHERE bla bla";
         objStmt = objDBConn.prepareStatement(strSQL);
         objStmt.setString(1, strStatus);    
         objStmt.execute();
         objDBConn.commit();
         iRetVal = 1;
       }catch(Exception e){
         iRetVal = -1;
       }finally{
         try{
           objStmt.close();
           DBHandler.releaseCSDBCon(objDBConn);
         }catch(Exception ex){}
       return iRetVal;
    //Here is the code that call the records again
      public static WorkOrderDetailingPolicy getWorkOrders(int iWorkOrderNo) throws CSDDBException{
        Connection objDBConn = null;
        PreparedStatement objStmt = null;
        ResultSet objWOPRs = null;
        WorkOrderDetailingPolicy objPWODP = null;
        String strSQL = null;
        try {
          objDBConn = DBHandler.getCSDBCon();    
          strSQL = "SELECT * FROM [Work Order Detailing] WHERE [Work Order No] = ?";
          objStmt = objDBConn.prepareStatement(strSQL);
          objStmt.setInt(1, iWorkOrderNo);
           objWOPRs = objStmt.executeQuery();
          if (objWOPRs.next()) {
            objPWODP = new WorkOrderDetailingPolicy();
            objPWODP.iWorkOrderNumber = objWOPRs.getInt("Work Order No");
            //......Get Record values
        catch (Exception e) {
          objPWODP = null;
          throw new CSDDBException(e.getMessage());
        }finally{
          try {
            objWOPRs.close();
            objStmt.close();
            DBHandler.releaseCSDBCon(objDBConn);
          catch (Exception ex) {}
        return objPWODP;
      }

    Hello,
    Can you put an example of your problem online?
    Are you sure you're not having problems with case sensitive data?
    Thanks,
    Dimitri

  • Get the date of a particular week day from given date

    I have a given date.
    from that date i want to get the date of sunday of that week
    wat is the best possible way to do the same.
    for eg:
    if i am given 03/11/2007 which is a saturday
    i want to get 27/10/2007 which is the sunday which falls in the same week as of 03/11/2007
    can anybody please help.

    hi,
    Here I am posting code for your requirement.
    Here I am hard coding the date value.
    import java.util.*;
    public class DateTest{
         public static void main(String ar[]){
              Calendar calendar =new GregorianCalendar(2007,7,4);
              System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
              calendar.set(2007,7,4-calendar.get(Calendar.DAY_OF_WEEK)+1);
              System.out.println("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
              System.out.println("MONTH: " + calendar.get(Calendar.MONTH));
    }

  • Get current date in mm/dd/yyyy format

    Need to get todays date in the format mm/dd/yyyy and store it in a database by using JDBC API ..how to convert Date given by Date() to the format mmdd/yyyy .The column type of the table whr date has to be inserted is of Type Date/Time (Microsoft Access)..
    Plz help me out ..plzzz..

    public static byte TIME_ONLY = 1;
    public static byte DATE_ONLY = 2;
    public static byte DATE_ALL = 3;
    public static String getCurrentDateTime(byte format, String dateFormatPattern) {
         String[] stringArray;
            String sDate;
         Date today;
         SimpleDateFormat formatter;
         formatter = new SimpleDateFormat(dateFormatPattern);
         today = new Date();
         sDate = formatter.format(today);
         if (format != DATE_ALL) {
              stringArray = sDate.split(" ");
              if (format == DATE_ONLY) {
                   sDate = stringArray[0].trim();
              } else {
                   sDate = stringArray[1].trim();
            return sDate;
    }

  • How to get the Date in a particular format?

    Hi,
    How to get the Date in the below format? I will be passing the year in my method..
    2/10/2003 9:46:52 PM
    D/M/YYYY H:M:S A
    public Date getDate (String year) {
    Here i want to get the Date in this format
    2/10/<Passed Year> 9:46:52 PM
    Thanks

    This is my code
    public static Date getCalendar(Calendar calendar,int getYear) {
    String      formatted_date="";
         int year = getYear;
         int month = calendar.get(Calendar.MONTH+1);
         int day = calendar.get(Calendar.DATE);
         int hour = calendar.get(Calendar.HOUR);
         int min = calendar.get(Calendar.MINUTE);
         int sec = calendar.get(Calendar.SECOND);
         int am_pm =calendar.get(Calendar.AM_PM);
         formatted_date = month+"/"+day+"/"+year+" "+hour+":"+min+":"+sec+" PM";
         System.out.println("formatted_date is "+formatted_date);     
         o/p : formatted_date is 1/4/2006 1:44:21 PM
         SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    //     DateFormat dateFormat =DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
         Date passdate = new Date();
         try {
              passdate = dateFormat.parse(formatted_date);
         } catch (ParseException e) {
              System.out.println("Invalid Date Parser Exception "+e.getLocalizedMessage()+"DateFormat is "+dateFormat);
              System.out.println("The Date inside the function is "+passdate+"and the year passed is "+year);
    o/p : The Date inside the function is Sat Apr 01 00:00:00 IST 2006and the year passed is 2006
         return passdate;
    Expected O/P is 3/1/2006 1:44:12 PM
         }

  • Creation of a table with static data(not a DB table)

    Hi
    I need to display a table with some static data in an OAF page. This table is not a DB table. It is like an HTML table
    I have placed the following query
    SELECT 'A1','B1' FROM DUAL UNION SELECT 'A2',B2' FROM DUAL in the VO. But it is returning a single row which is acting as the header of the table.
    Can anyone help me to create the table with 2 rows inserted in it.
    Thanks
    Edited by: gsaxena on Aug 4, 2009 3:04 AM
    Edited by: gsaxena on Aug 4, 2009 5:24 AM

    Hi
    Please execute your VO inside the CO of table region ,right now it is not getting executed,thats y it is giving just column names
    use the following code PR method of CO
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject oav = (OAViewObject)am.findViewObject("XXVO");
    oav.first();
    let me know in case of any issue
    thanx
    Pratap

  • Best Practice for Using Static Data in PDPs or Project Plan

    Hi There,
    I want to make custom reports using PDPs & Project Plan data.
    What is the Best Practice for using "Static/Random Data" (which is not available in MS Project 2013 columns) in PDPs & MS Project 2013?
    Should I add that data in Custom Field (in MS Project 2013) or make PDPs?
    Thanks,
    EPM Consultant
    Noman Sohail

    Hi Dale,
    I have a Project Level custom field "Supervisor Name" that is used for Project Information.
    For the purpose of viewing that "Project Level custom field Data" in
    Project views , I have made Task Level custom field
    "SupName" and used Formula:
    [SupName] = [Supervisor Name]
    That shows Supervisor Name in Schedule.aspx
    ============
    Question: I want that Project Level custom field "Supervisor Name" in
    My Work views (Tasks.aspx).
    The field is enabled in Task.aspx BUT Data is not present / blank column.
    How can I get the data in "My Work views" ?
    Noman Sohail

  • How to synchronize concurrent access to static data in ABAP Objects

    Hi,
    1) First of all I mwould like to know the scope of static (class-data) data of an ABAP Objects Class: If changing a static data variable is that change visible to all concurrent processes in the same Application Server?
    2) If that is the case. How can concurrent access to such data (that can be shared between many processes) be controlled. In C one could use semaphores and in Java Synchronized methods and the monitor concept. But what controls are available in ABAP for controlling concurrent access to in-memory data?
    Many thanks for your help!
    Regards,
    Christian

    Hello Christian
    Here is an example that shows that the static attributes of a class are not shared between two reports that are linked via SUBMIT statement.
    *& Report  ZUS_SDN_OO_STATIC_ATTRIBUTES
    REPORT  zus_sdn_oo_static_attributes.
    DATA:
      gt_list        TYPE STANDARD TABLE OF abaplist,
      go_static      TYPE REF TO zcl_sdn_static_attributes.
    <i>* CONSTRUCTOR method of class ZCL_SDN_STATIC_ATTRIBUTES:
    **METHOD constructor.
    *** define local data
    **  DATA:
    **    ld_msg    TYPE bapi_msg.
    **  ADD id_count TO md_count.
    **ENDMETHOD.
    * Static public attribute MD_COUNT (type i), initial value = 1</i>
    PARAMETERS:
      p_called(1)  TYPE c  DEFAULT ' ' NO-DISPLAY.
    START-OF-SELECTION.
    <b>* Initial state of static attribute:
    *    zcl_sdn_static_attributes=>md_count = 0</b>
      syst-index = 0.
      WRITE: / syst-index, '. object: static counter=',
               zcl_sdn_static_attributes=>md_count.
      DO 5 TIMES.
    <b>*   Every time sy-index is added to md_count</b>
        CREATE OBJECT go_static
          EXPORTING
            id_count = syst-index.
        WRITE: / syst-index, '. object: static counter=',
                 zcl_sdn_static_attributes=>md_count.
    <b>*   After the 3rd round we start the report again (via SUBMIT)
    *   and return the result via list memory.
    *   If the value of the static attribute is not reset we would
    *   start with initial value of md_count = 7 (1+1+2+3).</b>
        IF ( p_called = ' '  AND
             syst-index = 3 ).
          SUBMIT zus_sdn_oo_static_attributes EXPORTING LIST TO MEMORY
            WITH p_called = 'X'
          AND RETURN.
          CALL FUNCTION 'LIST_FROM_MEMORY'
            TABLES
              listobject = gt_list
            EXCEPTIONS
              not_found  = 1
              OTHERS     = 2.
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CALL FUNCTION 'DISPLAY_LIST'
    *       EXPORTING
    *         FULLSCREEN                  =
    *         CALLER_HANDLES_EVENTS       =
    *         STARTING_X                  = 10
    *         STARTING_Y                  = 10
    *         ENDING_X                    = 60
    *         ENDING_Y                    = 20
    *       IMPORTING
    *         USER_COMMAND                =
            TABLES
              listobject                  = gt_list
            EXCEPTIONS
              empty_list                  = 1
              OTHERS                      = 2.
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDIF.
      ENDDO.
    <b>* Result: in the 2nd run of the report (via SUBMIT) we get
    *         the same values for the static counter.</b>
    END-OF-SELECTION.
    Regards
      Uwe

  • Problem converting static data load mapping to MOLAP

    Hi
    as a prototyping exercise I am converting some of our ROLAP dimensions and corresponding data load mappings (1 static data i.e. "-1" id to handle unknowns in fact data, and 1 for real data coming from a table) to MOLAP.
    The dimension itself converts and deploys correctly and the real data mapping also redeploys and executes correctly.
    HOWEVER
    my static data mapping will not execute successfully.
    The mapping uses constants (ID = -1, NAME 'UNKNOWN' etc), not all attributes are linked (this has been tried). My column WH_ID which was the ROLAP surrogate key gets converted to VARCHAR2 as expected. Mapping does deploy cleanly.
    The error i get is below. I have been banging my head on this for a couple of days and tried searching the Net, Metalink to no avail. I'm hoping someone out there can help
    LOAD_STATIC_D_TRADER_IU
    Warning
    ORA-20101: 15:48:04 ***Error Occured in BUILD_DRIVER: In __XML_SEQUENTIAL_LOADER: In __XML_LOAD_ATTRS: Error loading attributes for hierarchy, D_TRADER.AW$NONE.HIERARCHY, level D_TRADER.TRADER.LEVEL, mapping group D_TRADER.TRADER.MAPGROUP1.DIMENSIONMAPGROUP. In __XML_LOAD_ATTRS_ITEM: In ___XML_LOAD_TEMPPRG: The SQL IMPORT command cannot convert from the TEXT type to the DECIMAL type.
    TRUNCATE_LOAD=false
    AW Execution status: Success
    15:48:00 Started Build(Refresh) of MARTS Analytic Workspace.
    15:48:00 Attached AW MARTS in RW Mode.
    15:48:01 Started Loading Dimensions.
    15:48:01 Started Loading Dimension Members.
    15:48:01 Started Loading Dimension Members for D_TRADER.DIMENSION (1 out of 1 Dimensions).
    15:48:03 Finished Loading Members for D_TRADER.DIMENSION. Added: 1. No Longer Present: 885.
    15:48:03 Finished Loading Dimension Members.
    15:48:03 Started Loading Hierarchies.
    15:48:03 Started Loading Hierarchies for D_TRADER.DIMENSION (1 out of 1 Dimensions).
    15:48:03 Finished Loading Hierarchies for D_TRADER.DIMENSION. 1 hierarchy(s) STANDARD Processed.
    15:48:03 Finished Loading Hierarchies.
    15:48:03 Started Loading Attributes.
    15:48:03 Started Loading Attributes for D_TRADER.DIMENSION (1 out of 1 Dimensions).
    15:48:04 Failed to Build(Refresh) MARTS Analytic Workspace.
    15:48:04 ***Error Occured in BUILD_DRIVER: In __XML_SEQUENTIAL_LOADER: In __XML_LOAD_ATTRS: Error loading attributes for hierarchy, D_TRADER.AW$NONE.HIERARCHY, level D_TRADER.TRADER.LEVEL, mapping group D_TRADER.TRADER.MAPGROUP1.DIMENSIONMAPGROUP. In __XML_LOAD_ATTRS_ITEM: In ___XML_LOAD_TEMPPRG: The SQL IMPORT command cannot convert from the TEXT type to the DECIMAL type.

    Hi this looks like a bug in set based mode with using numeric dimension attributes and loading them from a constant. Row based mode is OK, which stages the data before loading the AW, but you probably don't want this.
    A workaround is to add an expression operator in the map. You will have to add a link from a source table/constant into the expression operator to satisfy the map analyser. But then you can add expressions such as your numeric attributes in the expression operator's output group, define the values for each expression and map these expression outputs (not the numeric constants) into your dimension. Hopefully this makes sense.
    Cheers
    David

  • How do I get the date to print at the bottom right of a page

    fI can't get the date to print at the bottom of a page. I go to page setup and header/footer and ensure that date/time is entered into the lower right corner box and the date still doesn't print on a page.
    == This happened ==
    Every time Firefox opened

    Try setting your bottom margin on File > Page Setup > Header & Footer to .3 or .4
    You probably are not seeing the date at the bottom in Print Preview either.
    On my system, with HP 6200 series, I experience the same problem if my bottom margin is set to 0 (zero).
    You may experience the same problem with headers with a 0 (zero) top margin.

  • Using workspaces for "ALMOST" static data

              Hi,
              The application that we are developing has the following requirement:
              We have a whole bunch of data that is ALMOST static as far as the application is concerned.
              However this data can change infrequently.
              We have two solutions in mind
              1) We are planning to have a StaticDataManager component that will handle the reading/updation of this data.
              All the other components of the application will get the static data from the StaticDataManager
              and cache this data to avoid communication between the components.
              The application will be hosted on a clustered WLS configuration.
              Now suppose an updation takes place, how best can we update all the components that have the cached data?
              2) In case we use Workspaces to cahce this static data, does the cluster configuration take care of
              updating the workspaces in the machines in the cluster?
              TIA!
              Sreeja
              

    If you do like you say and specify servera and then specify serverb
              respectively, then yes the workspace doesn't show the same information
              across the cluster. However, if you always specify the cluster, serverc,
              then no matter which side you update or read from the data is the same. So
              yes, if you specifiy a specific server in the cluster, and not the cluster,
              the data will not replicate across the cluster, and you lose concurrency.
              Let me paste in the output to show you what I am seeing which proves the
              data is being replicated with a single write.
              Tester ver. 1.00.00 ----> Test started...
              Connected successfully using http to ethouic97/198.171.100.107:80
              ws.store(DOG, FIDO)
              Connected successfully using http to ethouic97/198.171.100.106:80
              ws2.fetch(DOG)
              DOG = FIDO
              These are some system outs from the test app below with a few extra system
              outs. Notice if the cluster is always your connection point and not an
              individual server, in this case ethouic97. Then the answer to the original
              first question is YES, you can store near static data in workspaces on a
              cluster to have the data replicated across the cluster. However, you must
              always address the cluster and not the individual servers, in this case
              address ethouic97 never server 106 or 107 directly.
              Jonathon Cano
              "Mike Reiche" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Well, it does look like it works, doesn't it?
              >
              > Now try running the first half on one WLS instance and the other half of a
              different WL instance and
              > specify servera in the first half and serverb in the second half. If the
              workspace is replicated it should
              > work.
              >
              > It's broken now. Not really. Regardless of where the t3 connection is
              made, the workspace is
              > in the local WL instance.
              >
              > Mike
              >
              >
              > "Jonathon Cano" <[email protected]> wrote:
              > >Details:
              > >We are using a DNS cluster where serverc actually maps to servers a and
              b.
              > >If you set the workspace to SCOPE_SERVER, and use a t3client connection
              to
              > >the serverc, it can not be servera or serverb directly, then the
              workspace
              > >is updated or read from the data is persisted across both sides of the
              > >cluster. All reads and writes must be done using the cluster name for
              this
              > >to work. I use this to manage fail-over for some Vitria subscribers I
              have
              > >runnig at startup. I have a tester I wrote which works, here is the
              code:
              > >
              > > private void testWorkSpaces() {
              > >
              > > try {
              > >
              > > T3User userInfo = new T3User("system","password");
              > >
              > > T3Client t3 = new T3Client("http://cluster:80",userInfo);
              > > t3.connect();
              > >
              > > WorkspaceDef ws =
              >
              >t3.services.workspace().getWorkspace().getWorkspace("test",WorkspaceDef.OPE
              N
              > >,WorkspaceDef.SCOPE_SERVER);
              > > ws.store("DOG", "FIDO");
              > >
              > > t3.disconnect();
              > >
              > > T3Client t32 = new T3Client("http://cluster:80",userInfo);
              > > t32.connect();
              > >
              > > WorkspaceDef ws2 =
              >
              >t32.services.workspace().getWorkspace().getWorkspace("test",WorkspaceDef.OP
              E
              > >N,WorkspaceDef.SCOPE_SERVER);
              > > String dogName = (String) ws2.fetch("DOG");
              > >
              > >
              > > t32.disconnect();
              > >
              > > System.out.println(dogName);
              > >
              > > } catch (Exception e) {
              > > System.out.println("Test Work Spaces Failed.);
              > > e.printStackTrace();
              > > }
              > >
              > > }
              > >
              > >The first t3client connection echos out that it is connecting to servera.
              > >The second t3client connection echos out that it is connecting to
              serverb.
              > >However, the data being returned is the name FIDO which was written to
              the
              > >workspace when connected to servera. Thus, as long as you are connecting
              to
              > >the cluster, you get replication of data across cluster for workspaces.
              > >
              > >WLS 5.1
              > >
              > >Jonathon Cano
              > >
              > >
              > >"mreiche" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> >I am confused.
              > >>
              > >> Yes.
              > >>
              > >> >So why was the original answer to workspaces being used for clustering
              > >near static data NO?
              > >>
              > >> Because that's what the documentation says?
              > >>
              > >> Are you really, really sure it's being propagated? Or perhaps it's just
              > >being updated identically on both instances?
              > >>
              > >> Mike
              > >>
              > >> "Jonathon Cano" <[email protected]> wrote:
              > >> >I am confused. I am storing data in the workspaces right now, and I
              am
              > >> >using this data in a cluster. I can update the data in the cluster
              just
              > >> >fine, and both sides of the cluster are being updated. So why was the
              > >> >original answer to workspaces being used for clustering near static
              data
              > >NO?
              > >> >
              > >> >Jonathon Cano
              > >> >
              > >> >"Tao Zhang" <[email protected]> wrote in message
              > >> >news:[email protected]...
              > >> >>
              > >> >> But the problem is whether you want Exactly-once-per-cluster data or
              > >not.
              > >> >> If not, you can deploy the data object into each server in the
              cluster,
              > >> >but in the data object, it contains the logic of updating itself.
              > >> >> Otherwise, you have to make it a pinned service.
              > >> >>
              > >> >> It's hard to describe here.
              > >> >>
              > >> >> Hope the document can solve your problem.
              > >> >>
              > >> >> http://www.weblogic.com/docs51/classdocs/API_jndi.html#user
              > >> >>
              > >> >> Good Luck.
              > >> >>
              > >> >> Tao Zhang
              > >> >>
              > >> >> "Sreeja" <[email protected]> wrote:
              > >> >> >
              > >> >> >Thanks. Can you please elaborate on the solutions 1 and 2. We are
              > >trying
              > >> >to eliminate the
              > >> >> > usage of 3 - entity beans - since we do not want the components
              using
              > >> >the data to contact
              > >> >> >the entity bean every time they need the static data - as this
              would
              > >> >result in remote calls
              > >> >> >for every usage.
              > >> >> >Sreeja
              > >> >> >
              > >> >> >"Tao Zhang" <[email protected]> wrote:
              > >> >> >>No, the workspace can't be clustered, the data can't be propagated
              to
              > >> >other
              > >> >> >>servers in the cluster.
              > >> >> >>Of course , you can select one server as the data holder and other
              > >> >servers
              > >> >> >>will be t3 client. But it's time consuming to
              > >> >> >>connect to the data holder server.
              > >> >> >>Possible solutions:
              > >> >> >>1. RMI.
              > >> >> >>Deploy the rmi as pinned service which hold the data.
              > >> >> >>2. jndi
              > >> >> >>The data can be propagated by jndi's default behavior.
              > >> >> >>3. database or entity bean.
              > >> >> >>
              > >> >> >>Hope this can help.
              > >> >> >>
              > >> >> >>Tao Zhang
              > >> >> >>
              > >> >> >>Sreeja <[email protected]> wrote in message
              > >> >> >>news:[email protected]...
              > >> >> >>>
              > >> >> >>> Hi,
              > >> >> >>>
              > >> >> >>> The application that we are developing has the following
              > >requirement:
              > >> >> >>> We have a whole bunch of data that is ALMOST static as far as
              the
              > >> >> >>application is concerned.
              > >> >> >>> However this data can change infrequently.
              > >> >> >>> We have two solutions in mind
              > >> >> >>> 1) We are planning to have a StaticDataManager component that
              will
              > >> >handle
              > >> >> >>the reading/updation of this data.
              > >> >> >>> All the other components of the application will get the static
              > >data
              > >> >from
              > >> >> >>the StaticDataManager
              > >> >> >>> and cache this data to avoid communication between the
              components.
              > >> >> >>> The application will be hosted on a clustered WLS configuration.
              > >> >> >>> Now suppose an updation takes place, how best can we update all
              the
              > >> >> >>components that have the cached data?
              > >> >> >>>
              > >> >> >>> 2) In case we use Workspaces to cahce this static data, does the
              > >> >cluster
              > >> >> >>configuration take care of
              > >> >> >>> updating the workspaces in the machines in the cluster?
              > >> >> >>>
              > >> >> >>> TIA!
              > >> >> >>> Sreeja
              > >> >> >>>
              > >> >> >>
              > >> >> >>
              > >> >> >
              > >> >>
              > >> >
              > >> >
              > >>
              > >
              > >
              >
              

  • Static data in runnable objects of threadpool

    hi all,
    I have a threadpool and schedule Runnable objects into it.
    The runnble objects are run as per schedule.
    But I want to declare and initialize a static data in the runnable object. And I expect it to be initialised only once ie, the first time the runnable object is invoked by the threadpool and to be ignored in the subsequent scheduled invocations. And I want to access the static data throught the runnable object.
    I want to know whether the above behavior will take place or should i use any other ways to do this.

    Then maybe something like this?
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.List;
    import java.util.Date;
    public class RunnableWithPreviousState implements Runnable {
        private static class State {
         public Date startTime, endTime;
         public State() {
             startTime = new Date();
        private static List<RunnableWithPreviousState> runnables = Collections
             .synchronizedList(new ArrayList<RunnableWithPreviousState>());
        private State previousState, myState;
        @Override
        public void run() {
         myState = new State();
         runnables.add(this);
         int index = runnables.indexOf(this);
         if (index > 0) {
             index -= 1;
             previousState = runnables.get(index).myState;
         if (previousState != null) {
             // inspect previousState
         // do other processing
         myState.endTime = new Date();
    }Piet

  • How do i get the date when enter a week number

    Hi, can anyone tell me how do i get the date when enter a week number??
    let say, i enter week number 4 and year 2008
    result=26-01-2008
    thanks..

    import java.util.Calendar;
    public class testCalendar {
         public static void main(String args[]){              
              int year=2008;
              int week =5;
              Calendar now=Calendar.getInstance();
              now.set(Calendar.YEAR,year);
    now.set(Calendar.WEEK_OF_YEAR,week);
              System.out.println(now.getTime());          
    hai, anyone know why i can't get the result:27-01-2008
    i always get two day later. That is 29-01-2008
    no wonder how i change the week number and year.
    for example: week=7, year=2007
    expected result:11-02-2007
    but the result is 13-02-2007
    thanks..
    Edited by: Angel_Wei on Sep 1, 2008 11:58 PM

  • Reinitialization of static data by multiple applets

    Hi,
    I have a problem with initialization of shared static data by multiple applets. I have three applets running inside of different HTML frames in a multi-frame HTML framework. Applets are loaded as JAR files. In addition, every applet has one or two 3rd party JARs listed in the APPLET tag. Applets share the same codebase and run inside the same JVM.
    I use static data to perform the inter-applet communication. This is simply a static list of applet references that is being maintained in the base applet class (all applet classes are inherited from that class). The problem is that when applets get constructed, the static data in the base class sometimes gets reinitialized multiple times. As I understand, the static data should be initialized just once on initial load of the base applet class (applets have the same codebase).
    This problem seems to be caused by the race condition (applets initialize on different threads launched by the browser). Under some circumstances (I change the number and order of JARs, etc.) everything works fine. I can reproduce this problem on both Explorer 5.x and Netscape 4.7 (did not try others). I run applets using native browser's JVM.
    Has anybody had such problem before? Is it caused by the large number of JARs ? Is there any way to guarantee that static data will be initialized once in the multi-applet environment ?
    Thanks,
    hparfen

    Hi,
    Did you find something to solve your problem because I have exactly the same.
    Tony

Maybe you are looking for

  • How can i lock the position and size of all of my .app windows?

    I have had this problem for a few months now; I would size the window of one of my apps (lets use safari for example) exactly the size i want it, then i position it exactly in the center of my screen because I'm OCD like that, then I'm just browsing

  • TS1398 How do I read the WPA network key on my iPhone?

    I have an iPhone 4 that is already accessing the network. However, the network key is not written on the bottom of the router and I didn't memorize it. I want to give my MacBook access to the same network and I can't seem to pull-up the WPA key on my

  • WEB UI to create orders with ECC 6.0

    Hi gurus, I need to know if with SAP IS M/AM there is a way to create/modify orders by using a web ui. I ask you if there is something "SAP standard" that, through configuration, allows to call jha1x/jha2x transactions or better bapi_admgmtso_create/

  • How does scaling work under Windows 7 with the new MBP with retina display?

    After installing Windows in a boot camp partition on the new MacBook Pro, how does scaling work compared to OS X? Does Windows know to have several pixels imitate a single pixel like in OS X when running in 1440 x 900, or is there no scaling effect a

  • How to download upgrade to PSE 10

    I have PSE 6 downloaded on my pc and have now purchased PSE 10 - how do I install the upgrade - I have the installation code.