Best way to store data server side

Our APEX (v3.1) applications use quite a bit of stored procedures to implement the business logic. What do you think is the best way to maintain some complex state on the server (where complex is anything more than a string)?
Ideally I would like to store this pl/sql object (say "table of integer index by pls_integer") in a package variable, but I suppose that connection pooling would make that impossible. I am aware of apex_util.set_session_state() but that lets me store only varchars.
Should I have to come up with my own serialization / deserialization methods in pl/sql to convert maps into strings? Seems pretty weak ...
Thanks for sharing your (I'm sure) valuable insights.
G.

Actually quite the contrary. You would think connection pooling would not allow you to do this, but every time your package is initialized, the package state is reset. It calls dbms_session.reset_package, so you can use global variables and not have to worry about another user pulling your values.
You can test it to confirm, but basically when you hit a page, the first time your package is called modplsql resets the session state. So you can set global variables in Process #1 after submit and use them in Process #5, but once your page is done, the next person to grab the connection will have the package reset using the same logic.

Similar Messages

  • Best way to store data from a plot on hard drive

    I have a DAQ set-up that will be on 24/7 for several days, and the whole time it's streaming data to an XY-Graph with a limited buffer.  My question is, what's the best way to store my plot data in such a way that I can empty out my plot every few hours but if I want to pull up data from a few hours ago I would just have an option on my initial VI to view any old saved plot data.
    Basically, I'm trying to not overload my RAM with all my plot data so I'd like to save it to the hard drive while my VI is running, and only display, for example the last 8 hours worth of data... I've been looking at TDMS, but I'm not sure if that's the right solution.  
    much thanks!

    Hi,
    You could save your data using TDMS as well as ASCII to simply load it in another application later.
    Attached VI shows you how to save your data to a File after a certain amount of iterations, you can combine this then with your code and a timestamp.
    Christian
    Attachments:
    Save to new file every N samples.vi ‏20 KB

  • What is the best way to store data for this project?

    hey everyone,
    I have been subscribed to this for a while, not sure if I have ever actually asked anything though.
    I have a project on the go for myself/portfolio
    It is a booking sheet, where by I have a GUI that has a diary system of a day followed by time slots. This also has a date picker that can change the date of the booking sheet
    I want to be able to store mainly strings and ints,
    I need to be able to store, retrieve and on occasion change some data.
    I was looking at using something called JExcelAPI but I cant get that to work at all, I asked for assistance but was refered to here.
    what would be the best way to implement this data storage?
    davyk

    Hey everyone,
    Back again,
    I got this this little snippet of code working but want to ask you guys for a little bit of help on it. if thats ok?
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         String dataSourceName = "mdbTEST";
         String dbURL = "jdbc:odbc:" + dataSourceName;
         Connection con = DriverManager.getConnection(dbURL, "","");
         // try and create a java.sql.Statement so we can run queries
         Statement s = con.createStatement();
         s.execute("create table TEST1234567 ( column_1 char(27), column_2 char(150), column_3 char(150), column_4 char(150), column_5 char(150), column_6 char(150))"); // create a table
         s.execute("insert into TEST1234567 values('"+date+"','"+a+"','"+b+"','"+c+"','"+d+"','"+e+"',)"); // insert some data into the table
         s.execute("select column_7 from TEST1234567"); // select the data from the table
         ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query
         if (rs != null) // if rs == null, then there is no ResultSet to view
                    while ( rs.next() ) // this will step through our data row-by-row
              /* the next line will get the first column in our current row's ResultSet
              as a String ( getString( columnNumber) ) and output it to the screen */
                   System.out.println("Data from column_2: " + rs.getString(1) );
         s.execute("drop table TEST1234567");
         s.close(); // close the Statement to let the database know we're done with it
         con.close(); // close the Connection to let the database know we're done with it
    catch (Exception err)
         System.out.println("ERROR: " + err);
         err.printStackTrace();
    }there are more columns, but i cut this code down.
    my question is:
    I think I want a method with an if statement to see whether the table is created or not, if not create it, but how do I go about this? I have searched the API and google, but my brain is fried.
    Also do I always have to do the try/catch and have the code of Class.forname to Statement s in all methods that want to deal with the table?
    davy

  • What is the best way to store data to a file? Serialization?

    FYI: I am some what of a novice programer. I have almost finished my degree but everything I know about Java is self taught (never taken a course in java). Any way here is my question.
    So I have an example program that I have created. It basically just has three textpanes which also have the ability to contain images. Now I would like to learn how to store data to a file for later retrieval and decided to use a program such as this as an example. I am not sure if I should use the serialization API that java has or some other means such as XML. If I used XML I was not sure how to store the image data that would be contained in the text panes. I figured serialization would take care of that if I just serialized my main class and then restored it. So That is that I tried first. Is this a good direction to go?
    The problem I am having is that I cant seem to get the serialization to work the way I need it to. I am not sure what I am doing wrong because I have read many tutorials and looked at allot of example code but still dont understand. The tutorial I looked at most is [this one at IBM.|http://java.sun.com/developer/technicalArticles/Programming/serialization/]
    The eclipse project folder for my example program can be found here:
    [http://startoftext.com/stuff/myMenuExp/]
    zipped version:
    [http://startoftext.com/stuff/myMenuExp.zip]
    The main class is mainwindow.java. I know the source is kinda dirty. Any comments are welcome but I am most interested in how to solve this serialization problem. Thanks
    -James

    DrClap wrote:
    What will the nature of the data be? Just a handful of strings? A bunch of objects of different types reflecting the current state of your program to great depth and complexity? Something else?The data will be what is contained in three text panes. Each text pane containing rich text and images. For an example take a look at the example program in my first post.
    How will the data be used? Just write it out when the app shuts down, and read it all back in when it starts up? Do you need to query or search for specific subsets of the data? Is there any value in the stored form of the data being human-readable?Basically the data will need to be saved when the application shuts down or when the user selects save from the file menu. The data will be restored when the user opens the file from the file menu. It would be nice if the stored data is human readable but its not of primary importance.
    How often will the data be written and read? How many reads/writes/bytes/etc. per second/minute? Not often. Just a simple open and save from the file menu.
    How large could the data conceivably get?It will probably be a few paragraphs of formated text and less then a dozen images per text pane.
    Will reading and writing of the data need to occur concurrently?no.
    Do you need to add new data to the storage as your app goes along, or just replace what's there with the most current state?Replace with the most current state of the data.
    If it's a simple read once at startup, write once at shutdown, overwriting the previous data, read only by your app, not by humans, then serialization via ObjectInput/OutputStream is probably the way to go. If there are other requirements, you may want to go with XML serialization, a DB, or some other solution.Thanks for the information. Serialization sounds like the way to go. Even if I end up using XML serialization in the end it would still be of interest to me to learn how to use serialization without xml.
    I was trying to go with using serialization in be beginning but I cant seem to get it to work. Would you be willing to take a look at my example program. I attempted to implement serialization but it does not seem to work. Could you take a look and see what I am doing wrong. At this point I am stuck as i cant seem to get serialization to work.
    I am going to go ahead and mark this thread as answered because I think I already got most of the information I was looking for except what I am doing wrong with my attempt as serialization.
    Thank you jverd for your time.

  • Best way to store data

    Hi,
    i need to read some data in my application. Now this data are stored in a mysql db and are about 6000 rows. In another application that i've developed I used the sqlcipher library but I want to know if there is another way to storing data. This data will be absolutely crypted.
    thank you

    hi etS23 & welcome.
    You should perhaps investigate using Apple's CoreData as covered here:
    http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Gettin gStartedWithCoreData/index.html

  • Best way to store data obtained from a resultset !?

    Hi all,
    I am working on a verification process that is to be run on our DB upon every external db extraction prior to merge into our DB (which is being done manually now)
    What I have decided so far is to have a verifier interface that is implemented by a bunch of *Verifier classes.
    Then depending on the level of verification, a subset of these verifiers would run and populate a generic result object (per verifier) with the query results and whether the verifier passed or not.
    I was thinking of having the Result class employ a JTable to store the query result (from a resultset), but I can't seem to find a way to retrieve the data from the Jtable row by row (I'd like to obtain the result from the JTable row by row as it would be easy to format) or the entire table to display for that matter.
    Please advise if you think this is a good approach? and if JTable's a good idea!? if yes, how should i use it? otherwise, what would you suggest?
    Thanks a lot,
    Cheers,
    parachuter2b

    BigDaddyLoveHandles wrote:
    There's no need for a "table". Use a List<YourBusinessClass>. If you don't know collections take the tutorial:
    |http://java.sun.com/docs/books/tutorial/collections/index.html]Thanks, that's what I sort of did:
    I figured how to use the ResultSetMetaData to get the column names and therefore generate a report from any query by having its resultset.
    so created a Result class, which holds the resultset of the query, plus a boolean that indicates whether the verification passed or not.
    Now what I have problem with is formatting the resultset and displaying it nicely in a report. The problem is that the length of the values in the resultset are variable and using constant indentation doesn't work. What's the easiest way to get around this apart from going through the resultset once before displaying the report to calculate the indentations for every single item?
    Thanks,
    parachuter2b

  • What is the best way to store data on a network hard drive using CompactRIO RTOS and Labvew Real time?

    HI!
    I'm starting a project in which I have a low rate stream of data to read in a real time environment. I should store these data on a network hard disk without any PC with standard OS, I just have CompactRIO RTOS. How can I send this data to the network drive? Is it possible to just “write” data like I do for a standard file in LabView?
    Thanks for any help!!
    Il Conte
    dr. Valentino Tontodonato

    Il Conte,
    you have to keep in mind that normally the RT OS does not map drives other than the Compact Flash that it has onboard (C:\). There are exceptions such as
    -cFP-20xx which may have additional Flash Drives which can be addressed as D:\ Drive
    -CVS systems with IEEE-1394 interface can write/read to Firewire external Harddrives
    -PXI Controllers booted from a Floppy disk may map the floppy drive as A:\
    One solution to your needings may be to write data to files locally on your onboard CompactFlash and then transfer these files to a network location using FTP, provided the network drive you are pointing to supports FTP.
    Let us know if you need any more help with this,
    AlessioD
    National Instruments

  • What is the best way to store and search 2D data

    Hi,
    There is a set of data (~10k records ) in 2D dimension.
    like this :
    Col 1, Col 2, Col3....
    What is the best way to store and search those records ?
    Thanks in advance
    Wilson

    Hi,
    Either userObjet[][] if you know how much data you have, and the data size is fixed, or use a list of lists. E.g. A Vector of Vectors (some will probably say that you should use an ArrayList instead, and that could be the case, but it sounds like you would want to display the data later on, and a DefaultTableModel (for JTables) uses a Vector as data holder).
    Kaj

  • Best way to import data to multiple tables in oracle d.b from sql server

    HI All am newbie to Oracle,
    What is the Best way to import data to multiple tables in Oracle Data base from sql server?
    1)linked server?
    2)ssis ?
    If possible share me the query to done this task using Linked server?
    Regards,
    KoteRavindra.

    check:
    http://www.mssqltips.com/sqlservertip/2011/export-sql-server-data-to-oracle-using-ssis/
          koteravindra     
    Handle:      koteravindra 
    Status Level:      Newbie
    Registered:      Jan 9, 2013
    Total Posts:      4
    Total Questions:      3 (3 unresolved)
    why so many unresolved questions? Remember to close your threads marking them as answered.

  • Best way to store big amount of data

    Hi, i need to store a big amount of data, written in a txt its size is almost 12 mg, anyway it depends on the computer it runs, beacause what i want to store is all the shared files in a computer.
    Which is the best way to store it? Array string? textfile? List? I don�t need the data after the app close.
    Thanks

    Well, then which is the best solution? LinkedList or
    Tree? i only need to store the full path.
    What i didn�t say, my fail, is that i need to search
    for a file name once i have stored them...For searching, LinkedList will be very slow if it's very large. I think the same is true of javax.swing .tree.DefaultTreeModel, which is the JDK's only tree implementation. I don't know what Jakarta-collections has - it's possible they have a tree that offers fast searching. If you want to stick to the standard Java libraries, you'll want a Set for fast searching. TreeSet keeps the entries in sorted order. If you also need to display them as a tree, you can keep them in both a Set and a tree. If you don't have enough memory to do that, then displaying the whole tree isn't going to be useful to the user anyway, so rethink your goal.

  • Best way to store, present en input date/time

    Hi!
    I hope I can make myself clear. I'm designing an APEX application that has a couple of different date-type fields. That application is going to be translated in two different languages, that has different date/time representations. For example: dd-mon-yyyy hh12:miAM and dd-mm-yyyy hh24:mi. I'm now finding out what's the best way to store those date/time fields and hou I can present them in a report/form and how the user can enter them in a field.
    This is what I see:
    - I can set an application date format/application timestamp format. This has to be the in the format of the main language, in this case, English.
    - I also can make translated versions of the application. QUESTION: can I enter a different date format for the translated application?
    Do I have to make my fields of the date type or timestamp type?
    I hope someone can answer. If I'm not clear, please tell me!

    You can set the application date format using an application item
    &DATE_FORMAT_MASK.
    and set this item dynamically.
    Home>Application Builder>Application ####>Shared Components>Edit Globalization Attributes
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Best way to store all this data!!

    Hi i have run into a problem and cant think at the mo. I need to know the best way to store this data:
    Meet(List of events in meet, Runners in meet, Relay team in meet, Which runner/ relay team is registered for which event, results of each event updated once meet is run, event being run(or has finished) or not started yet so runners can still register for it);
    Runner(RunnerID, Name, D.O.B, national team affiliation, Gender, Events in?, Seedtime for each event?, actual time for event?)
    RelayTeam(RelayID, Team name, Runner names, seedtime for events, events in, Acutal time)
    Event(ID, Name, Meet in, Runners in which lane)
    I just want to know how i can store these to make it as easy as possible to update etc.
    Anyhelp apprec.
    Thanks
    J

    Crossposted: http://forums.java.sun.com/thread.jsp?thread=509544&forum=31&message=2419334

  • Best way to store documents and images in a web application

    All,
    Which is the best way to store the documents, is it Oracle DB or file system or Virtual Directory Mapping in weblogic.
    We are working on a Internet based application into CRM domain, there is a requirement where user can upload and download the documents (.pdf, .xls, .doc etc). Right now we are storing images in the DB. Is it advisable to store all the docs in database and will it scale up in future.
    PS: There is no scope for using content server because of business constraints.
    Please let me know, thanks in advance.
    Regards
    Girish

    Best way to store depends entirely on requirements.
    Why store it in the database when it for example is purely static images (e.g. used as part of the web GUI)? Instead that can be served up directly by a web server - which is specifically designed for this.
    If it is more than just an image, but include tags (non spatial data attributes), requires transaction control (e.g. updating an old passport/id photo with a newer one), auditing, filtering/searching and ordering, requires backup, needs security and access controls, and so on - than that is most definitely a database function.
    So the issue is not what the binary file is or contains - an image or pdf or something else. It depends entirely on how it is to be used and what the business requirements are in this respect.

  • Best way to hold data

    Hiu guys,
    I would just like to know your opinions on the best way to hold data.
    The data is in the following form,
    ProcessNo PageNo
    eg
    0 0
    0 4
    0 3
    1 5
    1 4
    etc
    I was thinking of using a two dimensional array but would it be better to use a linked list or an other way? Can you store two items in the same list position?
    Thanks in advance

    I would add something to what the previous poster said.
    You could also make it an example of a Property Bag pattern and abstract the properties to a container (for example a Hashtable) which would allow you to expand the property list more easily. As with most things, there's an up side and a down side. The up side being that if you get new properties, or have to take properties away you can do so more easily (with less invasion of the existing code). The downside being that there's a bit more work to do at the start.
    The question to ask is how much of this do you have to do? If you're only doing it for example for homework and you won't be using it any more, it's not worth the effort. Likewise if your property list won't ever (or hardly ever) change it becomes less workable unless you have lots of them to do. But if your environment is more volatile or you have lots of it to do for your project it becomes a viable way of doing things.

  • Best way to store a lot of image files??

    I am working on a new project which involve user upload image to server and then do searching and view image. there will be a lot of image files. image will be displayed in web page as thumbnails, so there may be resized pic stored in server or resize on the fly.
    What is the best way to store image like this? as files in file system? database? etc...?
    Thank you very much

    Since seraching is invloved use a database. A file system is not good place to search in.
    Using a database will allow you to store additional data as well such as comments about the images or the ratings given by the users.
    Of course you will have to develop a propper table structure for this.
    Also do not generate thumbnails all the time instead cache them once they are created. Atleast the thumbnails of the images that are displayed often.
    Also store the last updted dates with the images so you can loow the images to be cached by the clients or the proxy server. That will reduce repatitive requests for the same image from same client.

Maybe you are looking for

  • How to map free goods scenario

    how to map free goods scenario?

  • Latest (October 2011) update won't install.

    I have tried to carry out the latest update (14/10/11). It seemed to be working well, then the tv went blank and the white light at the front of the apple tv box started flashing rapidly. After a few minutes I got the 'connect to itunes' logo. I've r

  • Cannot connect to the specified SQL Server instance

    I am trying to install Microsoft System Center 2012 R2 Virtual Machine Management. I am getting the following error: Setup cannot connect to the specified SQL Server instance. Ensure that the server name, isntance name, and, if speceified, port numbe

  • Database access code prob

    Hi there, can anyone see if there is anything wrong with the code below. I can see that the variables have values when outputting to dos but I keep getting a NullPointerException. Any ideas why? Error: Exception in thread "main" java.lang.NullPointer

  • Mac Pro and G4 won't talk via ethernet

    Hi, I know this is child's play for many of you, but I'm at a dead end. I'm trying to network my new Mac Pro with my G4 MDD /dual 1.25/ V.10.2.8. I made sure that file sharing is on in both Macs, that the ethernet ports are active, and that I have a