How to make list syncho synchronized

i have a list objct and i want to save it in to database as object and want to retrive as object and reuse that object when i required . i am useing this code to save but it yhrow exception like java.io.NotSerializableException: manicdeals.site.mydetail.BasketItem where manicdeals.site.mydetail.BasketItem is my package structure
          public  void createCartHistory(String sessionId,String accountKey,List shoppingCart) throws SQLException, IOException, ClassNotFoundException
                    Connection connection=null;
                    PreparedStatement statement=null;
                    PreparedStatement statement2=null;
                    PreparedStatement statement3=null;
                    PreparedStatement statement4=null;
                    ResultSet rs=null;
                    ResultSet rs2=null;
                    Object obj = null;
                    //shoppingCart=new ArrayList();
                    //for(int i=0;i<shoppingCart.size();i++)
                    //     System.out.println(""+shoppingCart.get(i));
                 // List listArr = Collections.synchronizedList(new ArrayList(shoppingCart));
                    try
                    connection=DBConnect.getConnection();
                    String sql = "insert into shoppingcarthistory(sessionid,accountkey,cartobject)values(?,?,?)";
                    String sqlSelect="select sessionid,accountkey from shoppingcarthistory where sessionid='"+sessionId+"' or accountkey='"+accountKey+"'";
                    //System.out.println("sqlSelect"+sqlSelect);
                    String sqlDelete="delete  from shoppingcarthistory where sessionid='"+sessionId+"'";
                    //System.out.println("sqlDelete"+sqlDelete);
                   connection.setAutoCommit(false);
                    //check for record exist or not
                    statement2=connection.prepareStatement(sqlSelect);
                    rs=statement2.executeQuery();
                    boolean recordExist=false;
                    if(rs.next())
                         recordExist=true;
                    //System.out.println("after select"+recordExist);
                    // end for check record exist
                    // if exist delete
                    // delete if record exist with same session id and accountkey
                    statement3=connection.prepareStatement(sqlDelete);
                    if(recordExist)
                         statement3.executeUpdate();
                    //System.out.println("else for insert");
                    statement=connection.prepareStatement(sql);
                    // convert object to bytes to insert
                    byte[] bytes ;
                    System.out.println("1");
                    ByteArrayOutputStream out = new ByteArrayOutputStream() ;
                    System.out.println("2");
                    ObjectOutputStream objOut = new ObjectOutputStream(out) ;
                    System.out.println("3");
                    System.out.println("shoppingCart"+shoppingCart);
                    try{
                    objOut.writeObject(getSerializeObject(shoppingCart)) ;
                    //objOut.writeObject(shoppingCart) ;                    
                    }catch(Exception e){System.out.println(e);}
                    System.out.println("4");
                    objOut.flush() ;
                    bytes = out.toByteArray() ;
                    objOut.close() ;
                    // end convert object to bytes
                    statement.setString(1,sessionId);
                    statement.setString(2,accountKey);
                    statement.setBytes(3,bytes);
                    System.out.println(statement);
                    statement.executeUpdate();
                    connection.commit();
                    // reading cart object
                    }catch(Exception Ex)
                         ManicLogWriter.println("error in adding session history"+Ex.getMessage());
                    finally
                         DBConnect.closeRS(rs);
                         DBConnect.closeStmt(statement);
                         DBConnect.closeStmt(statement2);
                         DBConnect.closeStmt(statement3);
                         DBConnect.closeCon(connection);
          }createCartHistory method is to used for saving

Collections.synchronizedList
But this has nothing to do with the NotSerializable exception, which is probably thrown because it contains objects that don't implement Serializable.

Similar Messages

  • How to make list view the default in finder?

    Is there a way to make "List view" be the default view for all folders opened?
    I know that with a window open, you can hit CMD-1, 2, 3 or 4 for icon, list, column, or cover view, but I want "list view" to be the default.
    I know that in some windows I can set the list view the way I want it and then close the folder, knowing the next time it opens, it will remember it, but that doesn't seem to work for encrypted sparse-bundle drives. They ALWAYS come up in icon view, regardless of the previous view it was in.
    So hopefully, setting the overall default will help me solve this problem.
    TIA for any advice/tips!
    Steve

    I could swear that I've done this before, in exactly this way, and it worked fine on my internal HD, but not on my encrypted sparse-bundles. But now it's working.
    Sorry to have created chaff in the group. I should have tried again just before I posted....
    Steve

  • How to make list show up "selectively" on different regions?

    Hi,
    By default, "list" is in the Shared Component.
    Is there any way I can make the "list" NOT shared? Meaning that I want to control which "regions" the particular "lists" will show up or not.
    For example:
    On my APEX Home page, I want to have 5 Forms (Form1-From5) for the user to select from. And each Form contains 3 sub-forms: New Entry, Update and Delete.
    So on the Home page, I defined 5 regions (for Form1 - From5), and within each region, I have 3 "lists" for New Entry, Update and Delete and in turn each list calls appropriate form to perform "New Entry", "Update" or "Delete" accordingly. It looks something like the following:
    Form1
    Form1NewEntry Form1Update Form1Delete
    Form2
    Form2NewEntry Form2Update Form2Delete
    and so forth.
    However, since the "list" is shared components, whatever lists that I define in Form1 show up THROUGHOUT ALL 5 forms, that is "Form1NewEntry" and "Form1Update" and "Form1Delete", which is NOT what I want. Is there a way I can use "Condition" to make the "lists" show up in "region" (NOT page) selectively? And how (since there are MANY options in the "Conditions")?
    Or if not, could you suggest the alternative way of doing it? (ie: Form1 -> subformNewEntry
    -> subformUpdate
    -> subformDelete)
    I have an important demo coming up shortly. And this is our FIRST Apex application in the company to show its usability.
    Greatly appreciated,
    Helen

    I have a similar requirement. I have several tabs (Operations, Maintenance, Safety, etc.) and users get individually assigned rights. I have a table where I have all the users listed and I added one column for each tab so I can set whether or not that user has access to that tab. You could go the same thing with groups if you want.
    Basically, my table looks like this:
    USER_ID, USER_NM, PWD_HASH, SAFETY_TAB, MAINT_TAB, OPER_TAB, etc.
    where each of the _TAB fields is set up as a VARCHAR2(2) for just Y/N.
    On my home page, I assign an APPLICATION_ITEM called G_USER_ID (Global User ID) on login so I can track who it is. Then I set the condition statement on the tab to SQL QUERY RETURNS AT LEAST ONE ROW
    using the following query:
    select SAFETY_TAB from APEX_USERS
    where SAFETY_TAB = 'Y'
      and USER_ID = :G_USER_IDThis example would be for the Safety tab, but you can easily substitute others. It works pretty slick.

  • New to MAC from Windows...How to make list view the default global view

    Hi Everyone...I know there are several posts already regarding this topic but I still cannot figure it out...I am brand new to Apple as I have used Windows based PC's for most of my life.
    My question is...in Finder when I open a folder it displays all the contents in Icon view...which is not a very efficient way to display information.
    Is there any way to make all folders (regardless of whether I have previously accessed them or not) display in LIST mode?
    Please remember when posting your answer that I am new to MAC's...so please keep your answer in terms that a 5 year old could understand and implement . Thanks everyone...and I really like my new MacBook Pro laptop!!!

    I had the same problem when I first used Mac OS X. I wanted to rezize the finder window and alter the view etc. What I did was open up a window and customize it exactly how I wanted it, then hit command-N to get a new window. Usually this turned out to be how it used to be, but sometimes (maybe if you just change one thing at a time with a single drag or click or something) then the new window would be the changed version. Then close the finder windows making sure your changed one is the last one you close.
    This is by no means an exact science for doing this, but it seems to work occassionally just by fiddling around changing things then opening/closing windows.
    Hope this helps in some way!

  • How to make a method Synchronous in Repository Information System ?

    In SE80 Transaction i create a copy of object TSTC. I want to set the Execute method of that object to Synchronous. I tried in Repository information system but could not find anything related to it. Can anyone help me?
    Thank you.

    Hi Sandesh,
    Check if this two excellent weblogs may help you:
    /people/vikash.krishna/blog/2008/09/23/crm-2007-how-to--2-a-transaction-launcher
    /people/raja.g/blog/2007/01/24/displaying-r3-transaction-in-icwc-application
    They have a step-by-step example, either with SE80, either with SWO1.
    Kind regards,
    Garcia

  • How to make list numbering restart

    Hi everyone,
    I'm sure this is a really simple on that i just don't know, but what i'm trying to do is restart the numbering after every H2 (in the red in the image) i've played around wtih all the settings and can't work it out.
    So basically i just want the "3. Read text below......" to actually be #1. I have given them all the same style and this will be a big document so giving each set of numbers their own style isn't really realistic (i don't think)
    Any help is appricaited or if you need more infomation just let me know, thanks in advance
    Asher
    EDIT: I've been playing around and managed to get the effect i wanted, but i don't know how i did it, and also then the next level down now runs it's own number system without restarts so i basically still have the same problem. Any help would be great, thanks

    Willi's solution is ingenious.
    I never thought of using "Next Style" to assign the style for number 1 and another style for the rest.  But it is limited in that you can't swap number 1 with number 2 without having to reassign the styles.
    I use a diffrent method which, if I remember correctly, was suggested by Bob Levine shortly after ID introduced numbered lists.
    Here is an example of the text that I have numbered correctly
    I have two styles. One for the text that interrupts the numbers called Body Text and another style for the Numbers.
    I start by creating a numbered list for the Body Text.
    I'm adding a numbered list "tag" to this, but the Format is None. I've taken out any symbols for the Number and the Mode Starts At 1. The Level is also 1.
    Next I want to format the Numbers.
    After I set the Format and the Number symbols, I set the Mode to Continue from Previous level.
    After that, I set the Level to 2. At this point the numbers are continuing past the body text.
    But by setting the Level, this opens up the option to Restart Numbers at This Level After Any Previous Level.
    That is engineering-speak for start at 1 if there is another level of numbered list before this one.
    The benefit of this is I can add an item before Number 1, or delete number 1, or swap 2 for 1 and the numbering stays the same.

  • How to make list item multi select

    Hi all,
    I'm suing Oracle 10g and I want to make a TList multi-selectable and then how I can return the selected records
    Thanks in advance :)

    This is where you should go
    ttp://www.oracle.com/technology/sample_code/products/forms/index.html
    in add , with it is not possible with a default TLIST, LOV ...., so you'll need to create your own:
    for example, I use a normal block with a checkbox on each row for the user to select records

  • How to make List.contains(Object) work when you write your own .equals func

    I have a list of objcts of a class defined by me. I want to use the List.contains(String name) function to tell me if it contains an object of that name. I have overriden the .equals function as shown in [1]. I then use the code at [2] to to test it, with a bit of debugger output as shown in [3]. It is not working, my overriden method is not getting called by List.contains(String name).
    Can anyone tell me how to get this to work?
    [1]     @Override public boolean equals(Object esId) {
            if(esId.getClass().isAssignableFrom(String.class)) {
                System.out.println("object name " + this.eslimId + " compare to " + esId + " = " + this.eslimId.equals(esId));
                return this.eslimId.equals(esId);
            } else {
                System.out.println("wrong class");
                return super.equals(esId);
        }[2] graphics.getProcedures() returns private List<ProcedureGraphicSet> procedures;
    System.out.println( " graphics.getProcedures().get(0).equals(\"ESLIM_009\")= " + graphics.getProcedures().get(0).equals("ESLIM_009"));
    System.out.println( " graphics.getProcedures().contains(\"ESLIM_009\")= " + graphics.getProcedures().contains("ESLIM_009"));[3]
    object name ESLIM_009 compare to ESLIM_009 = true
    graphics.getProcedures().get(0).equals("ESLIM_009")= true
    graphics.getProcedures().contains("ESLIM_009")= false

    This is a gross violation of the contract for the equals method, and you are basically getting bitten by that. The equals method must be symmetric, meaning this must hold for all objects A and B:
    A.equals(B) == B.equals(A)This does not hold for your equals method because for any string A and custom object B:
    A.equals(B) == falseAnd, apparently, the List.contains() method is choosing to compare objects that way.
    You must iterate through the list and check the names yourself, or use some sort of functional package which provides a List.contains() type method which takes a Predicate object of some sort.
    Edited by: jtahlborn on Feb 11, 2008 11:03 AM
    Edited by: jtahlborn on Feb 11, 2008 11:03 AM

  • How to make list item as text item  in oracle forms 6i

    Hello all,
    I created one form with one list item named "Country".. This list item shows country name for the particular employee in the employee table.I created this list item as database field. In the enter query mode i search an employee , This should act as item text.. Suppose i want to add an employee in enter query mode then i fill all the necessary fields,and
    when i click "country" list item it should display all the country names from "country_tab" table..So based on the situation
    this should act as list item and item text.. Can i Do this ?.. Pls help me.

    hai Andreas Weiden,
    I simply explain my requirement:
    I want to insert data and quering data by using single form...So, I created one form with data block. This form created from employee table.I have one text item in this form named country.This is database item.
    Ok ,Now the actual problem comes.I press "Enter query" in tools menu,Then enter one employee number in employee_no field.after i press
    Execute query In tools menu. It shows all the details corresponding to that employee..
    Note: here "country" text item also shows employees country.
    Right, Now i have another requirement. In the same form I want to insert a new employee. For that
    I planed to changes country text to list item [ because when  insert i can easily pick up one country .it
    reduces typing work ] . I have another table "COUNTRY". Using this table, i should populate country list item..
    So, the country item should act as both text item [When quering] as well as list item [ When inserting ]
    Is there any idea ti do this ?
    If this not possible then what is the alternative ?
    Pls suggest me..

  • How to make list in a form display as tabbed options ?

    Hello,
    I'm adapting the original picture gallery from Spry Demos Adobe Labs. The demo has a drop down menu to select the menu options (countries) that control the data set of images to display (see code below)
    I need to display the select options in a tabbed display. Whilst I could achieve the desired effect with CSS on a Ordered List I couldn't do it with the Select tag used in the form in the demo.
    I've been tearing my hair out (there is not that much left) and would appreciate it someone could tell me the best way forward.
    Many thanks
    James
    <label for="gallerySelect">View:</label>
    <select spry:repeatchildren="dsGalleries" id="gallerySelect" onchange="dsGalleries.setCurrentRowNumber(this.selectedIndex);">
    <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" selected="selected">{sitename}</option>
    <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}">{sitename}</option>
    </select>

    You can edit the column definition and change the Display As attribute to "Display as Text (saves state)" that way the column will be saved with the other columns and the default value will be set.
    Thanks
    -Jorge

  • How to make list alpabetic?

    I have a list of names. What command arranges them in alphabetic order?
    Thanks

    Welcome to Apple Discussions
    Also, the free WordService (it might be CalcService - I use both) from Devon Technologies adds this ability to the application services menu. It does not alphabetize in a table, though, but, as Jerry said, Pages can do that.

  • Popup display ( How to make synchronous popup)

    Hi All,
    I'm using below code to display popup & no issue with that it's working fine but this is asynchronous display. I want to make popup to synchronous so that i can able to use popup input values in next step to perform some other logic. Please advice me how to make popup to synchronous.
    data: l_cmp_api           type ref to if_wd_component,
             l_window_manager    type ref to if_wd_window_manager.
      l_cmp_api           = wd_comp_controller->wd_get_api( ).
      l_window_manager    = l_cmp_api->get_window_manager( ).
      if wd_this->m_popup is initial.
        wd_this->m_popup = l_window_manager->create_window(
                 window_name  = 'TAXWARE_WINDOW'
                 TITLE = 'Limit Selection'
                 close_button =  abap_true
                 button_kind  = if_wd_window=>co_buttons_okcancel ).
      endif.
      wd_this->m_popup->open( ).
    Thanks & Regards,
    Anil.

    Hello, Anil,
    In WDA there's no way to do this. What you have to do is subscribe to a popup button event, and when the user clicks on a button, it will fire your event.
    data: l_cmp_api type ref to if_wd_component,
    l_window_manager type ref to if_wd_window_manager.
    l_cmp_api = wd_comp_controller->wd_get_api( ).
    l_window_manager = l_cmp_api->get_window_manager( ).
    if wd_this->m_popup is initial.
    wd_this->m_popup = l_window_manager->create_window(
      window_name = 'TAXWARE_WINDOW'
      title = 'Limit Selection'
      close_button = abap_true
      button_kind = if_wd_window=>co_buttons_okcancel ).
      wd_this->m_popup->subscribe_to_button_event(
        button  = if_wd_window=>co_button_ok
        action_name = 'ACTION_OK'
        action_view = l_cmp_api
        is_default_button = abap_true ).
      wd_this->m_popup->subscribe_to_button_event(
        button  = if_wd_window=>co_button_cancel
        action_name = 'ACTION_CANCEL'
        action_view = l_cmp_api
        is_default_button = abap_false ).
    endif.
    wd_this->m_popup->open( ).
    Then you create the ACTION_CANCEL and ACTION_OK events, and do your logic.
    Regards,
    Andre

  • How to make an index in InDesign CC 2014.1 using a topics list?

    Hi all,
    I have read the long help document on how to make an index in InDesign CC 2014.1 using a topics list, and still can't work out what to do.
    I have done a 548 page book, using a document for each chapter, and a book file to put them all together in the right order.
    I now need to make an index at the back, as the author has many quotes throughout the book at the start of each chapter and section.
    I have a list of those people quoted and want to upload this list and get the index feature in InDesign to find all instances of the name occurring in the entire book.
    After reading the help document I still cannot work out how to do this.
    My questions are:
    1. Do you have to use an InDesign document as a source for the list of topics? If so, should the document be added to the book file or outside it?
    It seems a bit recursive to have the list of topics in an ID document that is in the book file.
    2. Once you have uploaded the topics into the Index feature, how do you get it to look for all instances of that 'topic' througout the entire book? I can't figure that out from the help documents. What do I select? Do I do it from the Index panel? Do I highlight the text in the source document? Not sure how to do this...
    3. I need the names to list surname first of the quoted authors in the index. This command seems to be different between various editions of ID. For ID CC 2014.1 is it ctrl+alt+shift+]
    4. To make the surname show first, what do I highlight? The topic? and then do ctrl+alt+shift+] and select find all as well? Or do I have to just go through the text and manually do this and ditch the idea of uploading topics first?
    I am confused as you can see and any help with this is appreciated.

    Sorry 007, I really thought you were posting a trick question as on the OCP tests.
    Anyway, as Justin mentioned, if you have an index on ename, it may be used when doing a comparison predicate statement with the ename value.
    What it depends on are several other things: stats, how many rows in the table, use of an index hint, etc.
    Rather than questioning the group on this, why not just turn on autotrace and run the query for the different scenarios.
    The output will show you if it used the index, number of rows returned, blocks read, etc.
    SQL> create table emp (ename  varchar2(40));
    Table created.
    SQL> insert into emp select username from sys.dba_users;
    25 rows created.
    SQL> commit;
    Commit complete.
    SQL> set autotrace on
    SQL> select * from emp where ename != 'SYSTEM';
    Execution Plan
    Plan hash value: 2951343571
    | Id  | Operation        | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |           |    24 |   528 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX FULL SCAN | ENAME_IDX |    24 |   528 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("ENAME"<>'SYSTEM')As you can see, the above used an index, even though there were only 25 rows in the table.
    You can test each of your scenarios, one by one, including use of a hint.

  • How to make select list as read only

    Hi All.
    when i m loading a page ...how to make value of select list as read only ..
    i tried doing this ....
    i added readonly attribute to the select list's element attibute ...it is showing as read only field by darkening the select list field but ... the select list is editable even now... its allowing to choose from drag and drop ...
    Thanks & Regard ,
    Nandini

    I have the same requirment..
    I have a select list on a editable form and i want to make that one read only.
    When I use read only property it doent do anything. (But this is working for text items well).
    When I use "disabled' option it works fine. But then that value does not post when use POST the form. So making select list disabled is not a solution.
    Any Idea..
    Thanks
    mc

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

Maybe you are looking for

  • An easy way to update a song to a newer version in multiple playlists?

    i lost a bunch of my music due to a computer crash. bummer. i am slowly putting my library back together. is there a way to easily update have itunes recognize the song (same song...but this one does not have the exclamation point next to it) and rep

  • How to convert a workflow background task into a  general task ??

    Dear Experts , I am working om std SAP workflow for invoice document parking : I have done the following activities : 1. Activate Work flow Template for Document Completion     Here i activated the event   "Complete the Parked Log. IV Document"--> In

  • Issue with VO extension in expert mode unchecked

    hello i ma try to extend a VO which having Expert Mode Uncheck and Vo is EO base d is it possible to extend that VO regards Vivek

  • PSE9:Housecleaning "MyPictures" of duplicate Folders & Files

    Hello!   I am currently running WinXPro and have just upgraded to PSE9 days ago. Problem; The XP, " My Pictures" folder is bloated with several thousand duplicate or saved/copies of files/folders that were placed there for safe keeping, salvaged from

  • Update graphic card driver

    Hey, guys. I have a macbook pro with 330m nvidia card on board. I started to play Skyrim(a game) in windows 7 a few days ago. Knowing the graphic card driver is not updated, I have been always ponderring on if it worth a try to update the driver on m