Handling File(s)

Hello,
I was wondering what would be the best solution when handling one or more files to be used within an application. I am talking about whether I should only keep their path in memory, and access them only when needed, or else I should load the content of these files directly in memory, and access them from there.
Naturally I am talking more about xml files that contain certain configuration and information on not plain text.
I know about some of the pros and cons of both of them. If I just place a reference to these files in memory, then it means that the application will take little time to load, but will take more time to load the contents from the file (since there is open of file, search in it close file and so on). In the second method (load all in memory) it would take more time to start the application but I guess it takes less time to read the data then.
I was wondering whether anyone has any suggestions about this. At the moment I am more inclined in the load all in memory option. However do not know if this is the best solution or not!
Thanks and Regards,
Sim085

Hello,
I was wondering what would be the best solution when
handling one or more files to be used within an
application. I am talking about whether I should
only keep their path in memory, and access them only
when needed, or else I should load the content of
these files directly in memory, and access them from
there.[snip]
I was wondering whether anyone has any suggestions
about this. At the moment I am more inclined in the
load all in memory option. However do not know if
this is the best solution or not!
Thanks and Regards,
Sim085As you've said, it depends on your situation. On one end of the spectrum we have the scenario where you have a few pieces of data that are never changed and used frequently throughout your system. In that case, it's clear that you should read the files at startup. On the other end we have the scenario where you have a large amount of data that changes frequently and is needed relatively rarely in one part of your system. In that case, it's clear that you should read this data only when needed. Your case likely sits somewhere between those extremes and you'll need to weigh the trade offs to come to your design decision. If you are aware of what the pros and cons are (and it sounds like you are) then I think you've what you need to make your decision.
Good Luck
Lee

Similar Messages

  • How to handle file on application server without coading?

    HI all,
    can anybody tell me How to handle file on application server without coading? Is there any solution?
    Thanks in advance.

    > can anybody tell me How to handle file on application server without coading? Is there any solution?
    what is that you want to handle. what you do if you don't code ...

  • [SOLVED] Braid AUR "ERROR: There is no agent set up to handle file..."

    SOLUTION AT BOTTOM OF THREAD!
    I have installed numerous AUR packages in the past.  However, this is the first that I am unable to figure out.
    I assume I am supposed to extract the tar, copy the Braid package files (from my owned copy of Braid) to the same directory, run makepkg, then install via pacman.  The problem I am having is when I go to use makepkg I get the following error:
    # makepkg -s
    ==> Making package: braid 1.0.2-1 (DATE TIME)
    ==> Checking runtime dependencies...
    ==> Checking buildtime dependencies...
    ==> Retrieving Sources...
    ==> ERROR: There is no agent set up to handle file URLs. Check /etc/makepkg.conf.
    Aborting...
    I am not finding any solutions on Google.  Please help!
    Edit - Edited to show thread solved.
    Last edited by qKUqm3wtY4 (2013-01-03 17:00:49)

    SOLUTION! Provided by tdy
    braid-linux-build2.run.bin from Humble Indie Bundle 2 is required!
    You must edit the PKGBUILD file.
    source=("$_gamepkg"::"file://$_gamepkg"
    Change the source line to this:
    source=($_gamepkg
    Don't extract the braid file.  Just place it in the same directory as the PKGBUILD file.
    Run makepkg
    # makepkg -s
    Then run pacman
    pacman -U [filename].pkg.tar
    YOU ARE DONE!
    UPDATE!!!
    AFTER THIS THREAD WAS SOLVED, THE AUR PACKAGE WAS UPDATED TO SOLVE THIS ERROR.  JUST MAKE SURE YOU HAVE THE braid-linux-build2.run.bin FILE IN THE SAME DIRECTORY, AND THE INSTALL WILL WORK.
    Last edited by qKUqm3wtY4 (2013-01-06 09:18:11)

  • Aysnchronous BPEL ::Policy handling File

    Hi all,
    How to throw exception in aysnchronous BPEL and then catch in Policy handling File
    Edited by: user11336469 on Sep 4, 2009 5:46 AM
    Edited by: user11336469 on Sep 4, 2009 5:47 AM

    http://www.oracle.com/technology/tech/soa/cab/OracleSOACabWebinar03-25-08SOAExceptions.pdf
    This will help u

  • Is it possible to reload Handler files without shuting down OC4J

    Is it possible to reload the Handler files in OC4J ?
    When a new Handler file is generated by the JAG I need to restart OC4J otherwise I get a Handler not found exception.

    Handlers are java-classes so I would say yes.
    Classes (including BC4J View and Entity objects) must
    be recompiled and your server should be restarted.
    Anything XML-related (including UIX) does not immediately
    force you to restart OC4J, although the MVC Framework
    descriptor-xml should be reloaded by for instance re-
    entering the service you changed. This is where those
    home-page services become handy.
    Note that setting existing BC4J-attributes to (in)visible
    or wider/smaller mostly just changes the BC4J Jheadstart
    metadata and generates new UIX, so it doesn't change
    anything in the java-classes.

  • Prblem white handle files using External tables

    Hi,
    I Created an external table to handle files.
    Its working fine.
    But it is rejecting the records, where the fnal column in a record contains no (null) value.
    The data is as follows.
    empno|name|positon
    184|abc|supervisor
    185|xyz|
    186|efg|clerk
    I have given '\n' as row delimiter. and '|' as field delimiter.
    For the above data I am getting only the 1st and 3rd records only.
    External tables are not accepting the 2nd re4cord.
    In the log file it is specifying the error as "KUP-04023: field start is after end of record".
    Could anyone please give me some idea to solve this problem.
    Thank you,
    Regards,
    Gowtham Sen.

    Hi Michaels,
    I have one more doubt.
    After I added the clause "MISSING FIELD VALUES ARE NULL", its working fine.
    Case 1:
    The data is as follows.
    empno|name|positon
    184|abc|supervisor
    185|xyz|
    186|efg|clerk
    Now I am getting the data while query the external table as follows
    empno name position
    184 abc supervisor
    185 xyz <null>
    186 efg clerk
    Case 2:
    But there is a case that the data my come in the following way.
    empno|name|positon
    184|abc|supervisor
    185|xyz|
    186|efg|clerk
    18
    187
    For this data I am getting the data if I query external table as follows.
    empno name position
    184 abc supervisor
    185 xyz <null>
    186 efg clerk
    18 <null> <null>
    187 <null> <null>
    Here I would like to result the last records because, the records violated the formating. But its not doing as I expected.
    Do I need to add any other clauses.
    Thanks in advance,
    Thank you,
    Regards,
    Gowtham Sen

  • Error handling : File( sender and receiver)

    Hi Experts,
    This is regarding some information i require in the Error Handling mechanisms we can use while picking up the file through File Sender Adapter and while placing the same on the receiver adapter :
    Scenarios like :
    a)  Validations we can put , on the file , should that be done in SAP XI or after placing in SAP ERP.
    b)  If the file is of a different format and isnt picked up how can that be handled ? ]
    c)  if the File contains wrong data , should  the alert be generated in SAP or SAP XI ?
    d)  If the file does not arrive in the folder itself what is the error handling meachanism ?
    e) diff
    thanks
    Dev

    a) Validations we can put , on the file , should that be done in SAP XI or after placing in SAP ERP
    Do validations on File mean perform a check on the file for its contents, format, structure? If yes, then these are performed in XI/ PI
    b) If the file is of a different format and isnt picked up how can that be handled ?
    The file channel will throw an error if it is not able to find the file (specified in sender channel) during its poll interval.
    c) if the File contains wrong data , should the alert be generated in SAP or SAP XI ?
    If SAP is the target system, then better the check and alert be done in SAP XI/ PI, as far as possible we should avoid sending wrong data to the target.
    d) If the file does not arrive in the folder itself what is the error handling meachanism ?
    Which folder are you talking about? If it is source folder then the error will be thrown as mentioned in point b.
    If it is target folder, then the error (if any) will be captured either in IE or AE of SAP XI/ PI and can be intimated using alerts.
    Regards,
    Abhishek.

  • Handling File in Configuration Folder

    Hi,
    I recently posted about a possibly corrupt file that I cant access anymore. I have what are technically "backups" but they are exports, not actual copy and paste files that I can change.
    I found out through some research that I can access some weirdly named file titled TMP019238blahblahblah. I opened it, and all my stuff was there. I didnt want to mess with it since this seems to be my last chance at getting a lot of my work back.
    How should I go about handling this? The samething pops up as in the original file "unable to load scene, your document might be damaged" but its saved anyway. I tried copy and pasting a few frames from the tmp file into a new document, but Adobe crashes when I open it.
    How can I save the tmp file as a regular file and change/export all the new work I had that was lost in the original?
    thanks,
    Daniel

    Never mind. I was plying around with it again and figured it out. I had to move the actual file from the desktop into the application folders via finder. And now it works perfectly.

  • Handling file objects in the EJB layer

    It is seen that file handling in the EJB violates the specs.
    But, I have the requirement to read and parse some xpdl(xml specification) file in EJB.
    The parsing function is already in the EJB layer and the filepath is obtained as input from jsp(in the request) in a servlet.
    Im passing the filepath as a parameter to the bean method before parsing.
    Now the requirement is to construct the File object out of xpdl file and pass it as a parameter to EJB method. How can this be achieved?

    Hi,
    I'm not sure if this is helpful or not, but I just wanted to ask: If you know you need to parse the file on the EJB side, why not just go and do it? If you can always guarantee that files will be present in the same location that the beans are deployed to, then I don't think there is anything stopping you from reading them, if you know the full path to each file?
    You wrote that the path to the file is obtained from a JSP page. If those files need to be parsed anyway, you could move the parsing code to your JSPs (servlets), and use ServletContext.getResourceAsStream to read the contents. Then you could send the contents as a parameter to your EJB call.
    One last thing: if the files are large, you might want to consider using JMS and message-driven beans to do the reading/parsing job. Your MDBs could then call the EJBs, but you would have to return your results in an asynchronous manner.
    Just a couple of thoughts.
    Mark

  • About the Rejection Handler (File Adapter)

    I use file Adapter to get the information form other applications and transform the data format to XML . I want to kown ,when will the Rejection Handler of the file Adapter take action ,can i do some predefine to the Rejection Handler to reject the specifically data ?

    Hi,
    The rejection handler only comes into the picture when the input data is invalid as per the schema definition. i.e. you can reject invalid data so that it can be corrected and enqueued again. You can choose to set up your rejection handling mechanisms in bpel.xml.
    See the fllowing post for config info on rejection handlers:
    Re: How can I make my read file server still work when it read a wrong file?
    Regards,
    Narayanan

  • Forward Error Handling - File interfaces?

    Hello Experts,
    Can we use Forward Error Handling (FEH) for implementing error handling in File Interfaces ?
    Like for simple Application Server file interfaces, if something goes wrong during the process of writing/reading a file on App Server, can we use FEH for showing the log?
    I know it is a concept used for PI...so we want to know if it can be used for file interfaces as well? Just want to keep similar approach for error handling and logging (for both PI and File Interfaces).
    Thanks.

    Edit 1 May 2015: Added inbound
    Just a slight correction.
    FEH is used in the ABAP backend systems and are only for asynchronous inbound proxy interfaces. It is not available for sync proxies, IDocs, BAPIs. Neither is it available for any error handling on the PI system itself.
    PI/XI: Forward Error Handling (FEH) for asynchronous proxy calls with the use of Error and Conflict Handler (ECH)
    Message was edited by: Eng Swee Yeoh

  • How can/should I handle file versioning during a TFS Continuous Integration Build?

    Hi all,
    First, I've gone through many docs, links, etc to get a test Build Server up and running along with a successful first Build Definition using both the default and a customized template.  I say this because the question(s) I'm about to ask may have been
    buried in all that information that is now swirling around my head.
    First it might be advantageous to quickly look at what we do now.  In our script we have Major, Minor, Build, and Revision variables that are manipulated both manually and in code.  Let's say we are creating a version 10 of our product.  I
    will go in and edit the Major (10), Minor (0) and Build (0) numbers manually before that versions first script run.  The Revision number is bumped by 1 with each subsequent build.  So, build one of v10 will be 10.0.0.1, then 10.0.0.2, etc.
    This 4 segment version is then used to set the PRODUCT version of the compiled files.
    Later in the build script, we do a dance to get three position version number for our Windows Installer packages since Microsoft only utilizes #.#.# in that realm.  It's basically Build# * 256 + Revision# or something to that effect.  This
    is then passed in to the package.  I guess this part of it could or will need to be handled with an external script and InvokeProcess, which is fine.
    My main concern deals with how versioning works within the confines of a TFS Builds.  I believe I read something about tokens that may be the answer.  What I would like to happen is that all FILE versions are bumped automatically with each build. 
    I don't know if there is a setting that can be utilized within each solution/project that could handle that or not.  Then I'm hoping I can somehow get the Major, Minor, Build and Revision numbers for script use, etc.
    Is there a canned way of going about this or should all of this be scripted in some way with maybe  Pre MSBuild/compile script set up in the Build Definition.
    Any help/guidance with this would be greatly appreciated!
    THANKS IN ADVANCE!!!

    Hi NitLions, 
    Thanks for your post.
    Do you mean that you want to custom assembly file version in each CI build? As far as I know there’s no an standard way of changing the assembly version as part of each build, you can refer to the solution in this article:
    http://tfsbuildextensions.codeplex.com/wikipage?title=Build%20and%20Assembly%20versioning%20%28alternate%20to%20above%20using%20SDC%20Tasks%29.
    Or the information in this article:
    https://tfsversioning.codeplex.com/documentation.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How does Aperture handle file structure

    I have been working with iPhoto since its infancy and have one big issue with it, namely that it is such a closed system. I dislike that everything needs to be imported and exported to use it elsewhere, clogging up my computer with all these duplicates. Does Aperture handle that better? I spent 2 hours reading different reviews and discussions and for some reason, nobody seems to discuss exactly that, maybe most people don't mind to have a vault structure? If so, how do you handle sharing files outside of the tools like Facebook export etc that are offered?
    Thanks ~ Barb

    namely that it is such a closed system.
    It's not. It's a Database and this
    everything needs to be imported...
    is a characteristic of databases. This
    and exported to use it elsewhere
    is just not true if you use any of the very many ways that the OS and other applications integrate with iPhoto. I rarely, if ever, exported from iPhoto when it was my primary Photo app.
    The point is not to defend iPhoto, but if the database aspect of it irritates you then run a mile from Aperture. Everything has to be imported and can be accessed only in (pretty much) the same ways as they can be in iPhoto.
    how do you handle sharing files outside of the tools like Facebook export etc that are offered?
    Here's a stock answer I use over on the iPhoto forum. You can pretty much swap the word 'Aperture' for iPhoto:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    +*(Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)+*
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    Regards
    TD

  • Error Handler (File not Found) missing .cfm

    Hi,
    I have multiple applications on my server. For each
    application I would like an error handler that will catch missing
    .cfm files. If a user types in www.abc.com/test.cfm, and test.cfm
    does not exist, each site will use its own "errorHandler.cfm" file
    for example.
    I already can handle .htm and .html files in IIS, basically
    when the 404 error happens, it calls my html error handler. I also
    tried checking the option in IIS where you see a list of file
    extensions, you go to .cfm (this is all in IIS), and there is a
    checkbox that says "check if file exists", so I have checked and
    unchecked this, but not luck.
    In CFAdmin there is an area where you can specify a missing
    template handler. This seems to apply to the whole server. Each of
    our application are very different, I would like to have an
    individual error handler in each application.
    I am getting a CF error, (File not Found) not an IIS error
    when you type a file in the url string as mentioned above. I tried
    using <cferror> in my Application.cfm file, but to no avail.
    I tried using try/catch to no avail. I have heard of others having
    this frustration as well.
    Help is greatly appreciated
    -Westside

    I've not tried this, but consider having the server-wide
    error handler look at the CGI.HTTP_REFERER variable to see what
    application threw the error. Then do a <CFLOCATION> to the
    application-specific error handler.

  • 11g issue in handling file datastore from different server

    Hi All,
    In ODI 11g we have standalone agent as well as weblogic server agent. In our case master/workrep and weblogic server agent is installed in one of the linux server Say (A).
    We have a scenario to pick the file from one of the different linux box SAY (B). We have child agent running on that box and it is associated with the main weblogic agent under load balancing.
    While setting the topology information for file datastore it just need the driver name and path. At run time how odi will pick the respective file from that server
    Eg:File in location: /app/soa/uo1/testfile/test.txt(B)
    File path:/app/soa/uo1/testfile/test.txt(B)
    ODI Client will start the execution using the Server A weblogic agent. How ODI will route the control to child agent and try to find the file in ServerB and not in server A.
    in my case it is going to server A and saying file doesnot exist......
    Is it really possible to assign the proper server detail, so that we can make sure that execution will happen properly. I am not sure about the weblogic agent and how it control the execution. I think in my case its weblogic agent which is trying to look for the file in server A, where it is installed and thus failing.
    Control is not passing to the proper child agent as expected?
    Any idea?

    There is a difference in your understanding of the load balancing and the way it is implemented in ODI agents.
    In your case, the weblogic agent exists on Server A and hence it expects that the file also be visible to the agent and be local to server A.
    Load balancing comes into picture when there are too many connections for Agent A and it shares its load with other agents. This logic of passing control is within the agent and when file systems come into picture, the filesystem should be visible to all the agents.
    There is no concept of parent-child agents. The agents are simply load-share agents.
    So, Load balancing is not going to give you what you want.
    In your case, you should execute the job using Agent on server B so that appropriate filesystem can be accessed.

Maybe you are looking for

  • Instructions "if-then-else" in the texte

    Hello I need to create a RTF template with the management of civility : I tried this: <?xdofx:if MM = 'MRS' then 'Mrs.' else if MM = 'MR' then 'Mr.' else 'Mrs. and Mr.' end if?> And it just works. But when I add this condition in the texte, it does n

  • Networked PC connection fails

    I have a wireless network system (ATT) which has 2 pc's (Sony VAIO and Toshiba Laptop) wirelessly connected so they can access the internet and also network with my early 2009 iMac (which is connected but via ethernet). I can see and network with my

  • Retriving data using web dynpro

    I want to make simple application whic stores data and retrive specified fields using web dynpro. can anyone provide tutorial link to do this

  • Select List (query based LOV) in V. 4.1.1.00.23

    Hi guys, I am having some problems with an APEX application that I have exported from V. 4.1.0.00.32 and imported on V. 4.1.1.00.23. I have a Tabular Form region where I have a column which is Display As "Select List (Query based LOV)". If I add a ne

  • Odd DNS problems with wireless using WPA security.

    My partner and I have two Macbooks, hers is the white 1.83Ghz and mine is the white 2.0Ghz. The 1.83 with the latest updates (10.4.8) connects just fine and browses fine, no issues what-so-ever. My 2.0Ghz (also on latest update 10.4.8) does connect t