What is best way to do file i/o in ejbs?

We have a text file with messages that the EJB tier needs access to. Currently we do file streaming but I know that doesn't allow the container to handle that activity properly in the advent of problems.
What is the recommended way of dealing with file access in ejb?

Matt,
One of the projects where I worked tried to write to a log file from within an EJB (I believe they were using log4j). It worked fine in development (small log file, not many transactions on the app server), but generated errors in production. I believe the errors were "request timeout" since it was taking a long time to process the log file.
In the past I have created my own exception that contained a string identifier. At the top of the exception-chain I had an exception handler that would use the identifier to lookup user-friendly text in a database and formatted the error in a nice way. You might consider this method, but put the error handler in the web tier where it has legal access to the error-text file. But it sounds like your code does not have the error processing code as isolated as you would like.
I think that will close off this thread, unless someone wants to suggest a way of legally logging events and errors in the EJB container.
Todd

Similar Messages

  • Whats the best way of sending files ?

    whats the best way of sending files (mp3's) to another computer over the internet, been doing it over msn, but takes a while, is there any other way?

    Have you thought of using an intermediary file server, e.g. yousendit.com, rapidshare.de, etc? Alternatively, you could do it the computer-to-computer route by enabling either 'Remote Login' or 'FTP Access' (Sharing preference pane) on one and connecting with the other.
    As an aside, what you're doing isn't illegal, is it? Pardon my bluntness.
    Yang

  • Whats the best way to move files from a hard drive that wont boot?

    I made a bootable USB disk and it appears to work fine. I can still read and open files on the old disk (admin account only) from the new USB drive the old one doesn't boot. I don't have a backup but would like to move files to the USB and then reformat the old drive. 
    Whats the best way to capture the data?
    There are four user accounts on the old drive. Only one on the new drive so far. Do I need to set up four accounts on the new drive in order to copy data from each?

    Time Machine is for making backups and restoring ones it previously created. It doesn't restore data backed up or copied in other ways. In your case, it's better to use a cloning utility or manually drag the files than it is to use Time Machine.
    (124317)

  • Whats the best way to import files from my ipod to my itunes

    I recently had to purchase a new laptop, and would like to know if anyone has a good way to import my library from an Ipod Classic to my new laptop(running windows 8). I don't know what software is out there for PC based Itunes. I had Best buy back up my stuff to a external hard drive, but some of my library is missing. Any help would be much appriciated, thanks!

    Time Machine is for making backups and restoring ones it previously created. It doesn't restore data backed up or copied in other ways. In your case, it's better to use a cloning utility or manually drag the files than it is to use Time Machine.
    (124317)

  • What is best way to transfer files from an older imac to a new one?

    I have time machine on old intel imac.  I have 700gb used on old and don't want to transfer everything (trying to use this  "set up" process to also keep old unused stuff from transferring to the new imac). I can use firewire to transfer.  I have read the Apple support article on migration but I'm not clear on the ability to drag and drop only what I want to transfer. Thanks

    Thanks.  Wonder if you can advise further:
    As I noted, when I get around to starting  this transfer next week, I want to carefully move files to the new imac almost "one at a time" or groups of files at a time (not literally.)  Reason: 1. in order not to move some old files that I don't want on the new mac, but I'm reluctant to delete from old mac yet.  And 2. I'm fairly certain there is a corrupted file somewhere in the old mac. This is Apple Store Genius bar tech's conclusion after several visits and attempte over the last 6 months to do iphone 4 OS updates on this old mac which resulted in failure to update - received error "device not eligible for rebuild."  I was eventually able to perform the updates on my iphone 4 using my wife's newer Macbook, which she and my son use for their iphone 4s and with which they never encountered the same failure.  And yes, the latest ios5 update also failed on the old imac(again did the update using the macbook.
    (BTW, I did the update using the macbook, then return to the old imac to restore my iphone using the itunes on it.)
    Also, FYI -  this old imac is not a core 2 duo so it won't accept Lion.
    So that was a long way of saying I don't want to chance moving a corrupted file to the new imac.
    Therefore, can you direct me to instructions that would direct me to, as example, move this first, then this, then this, and so on.
    I have several users on this old mac, although my user has the most files, many iphoto and imovie files and it is critical that my user files are moved successfully.
    Also, I use time machine to back up on an external HD, and I use Carbonite too.
    Any advise appreciated.

  • What is best way to transfer files from my g5 to my macbook

    I'm giving my G5 away and need to remove email accounts from G5. I thought I'd done it last night but it turns out I'd deleted all emails from G5 therefore Cloud, Mobile Me and iphone. I bought the G5 first and that pushes to Mobile Me and MacBook. So when I delete on G5 it deletes from MacBook but not the other way around. I need to make MacBook my only machine. I used sharing to export itunes so have transferred all tunes. Now need to resolve the email issue and transfer documents if possible. I'm guessing that once I've done that I run a disk which resets the G5 to zero. Plus, the keyboard on my macbook is playing up, the return and shify keys do not work so I can't do question marks, exclamation marks etc. I've checked the language settings and key stick rate etc and all is as it should be according to Mac online support. Any suggestions

    Michael
    Simply copy the iPhoto Library Folder from Home/Pictures to the same location on the MacBook. If you want to view the pics you'll have to correct the permissions on them. To do this Download BatchMod from
    http://macchampion.com/arbysoft/
    And apply it to the iPhoto Library Folder using the settings found here:
    http://homepage.mac.com/toad.hall/.Pictures/Forum/BatChmod.png
    (Credit to Old Toad for this one).
    Use the User name from the MacBook, obviously... and if you restore them at a later point to the G5, you'll have to reverse the process.
    As for a monthly back up - repeat the process.
    When you say you got Duplicates, was this in the Finder? This is normal and to do with how iPhoto is organised.: A Note about the iPhoto Library Folder:
    In this folder there are various files, which are the Library itself and some ancillary files. Then you have three folders
    Originals are the photos as they were downloaded from your camera or scanner.
    (ii) Modified contains edited pics, shots that you have cropped, rotated or changed in any way.
    This allows the Photos -> Revert to Original command - very useful if you don't like the changes you've made.
    (iii) Data holds the thumbnails the the app needs to show you the photos in the iPhoto Window.
    Regards
    TD

  • Whats the best way to get a big text file in a CLOB variable?

    Hi,
    I have a very premitive type of question.
    I have a big text file, say 30 MB, in a Unix directory (Solaris). I want to get the whole text of that file in a CLOB variable.
    I saw the procedure dbms_lob.loadfromfile/loadclobfromfile. In both these cases, according to the documentation, the target where is collect the data will be a BLOB and not a CLOB. So, I have to convert that blob into a clob.
    If I want to avoid all this conversion process, whats the best way to get a text from a file into a CLOB variable?
    Please suggest.
    Regards

    In addition, LoadFromFile is overloaded to handle both BLOB and CLOB:
    PROCEDURE LOADFROMFILE
    Argument Name                  Type                    In/Out Default?
    DEST_LOB                       BLOB                    IN/OUT
    SRC_LOB                        BINARY FILE LOB         IN
    AMOUNT                         NUMBER(38)              IN
    DEST_OFFSET                    NUMBER(38)              IN     DEFAULT
    SRC_OFFSET                     NUMBER(38)              IN     DEFAULT
    <BR>
    PROCEDURE LOADFROMFILE
    Argument Name                  Type                    In/Out Default?
    DEST_LOB                       CLOB                    IN/OUT
    SRC_LOB                        BINARY FILE LOB         IN
    AMOUNT                         NUMBER(38)              IN
    DEST_OFFSET                    NUMBER(38)              IN     DEFAULT
    SRC_OFFSET                     NUMBER(38)              IN     DEFAULT

  • What is the best way to transfer files from a Power PC G4 that has NO power?  Thanks.

    What is the best way to transfer files from a Power PC G4 that has NO power?   I have a newer iMac. Thanks.

    Remove the hard drive and get one of these USB hard drive adapters. http://tinyurl.com/a5l2htj Then plug the adapter into your iMac to see/retrieve the files.
     Cheers, Tom

  • What is best way dealing with large tiff file in OSX Lion?

    I'm working with large tiff  file (engineering drawing), but preview couldnt handle (unresponsive) this situation.
    What is best way dealing with large tiff file in OSX Lion? (Viewing only or simple editing)
    Thx,
    54n9471

    Use an iPad and this app http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=400600005&mt=8

  • Whats the best way to transfer all my pic and vid files from Mac Air to back up drive to free up space on hard disk?

    whats the best way to transfer all my pic and vid files from Mac Air to back up drive to free up space on hard disk?

    Get a third drive if needed, open the Time Machine pane of System Preferences, set it not to exclude that drive, and drag the files to it. If you're moving an iTunes or iPhoto library, launch the application with the Option key held down and choose the moved library.
    (118789)

  • I have a macbook pro I use for work and iMac at home. What is best way to manage my files? Use iCloud? Dock my laptop when I come home? Appreciate any suggesitons

    I have a macbook pro I use for work and iMac at home. What is best way to manage my files? Use iCloud? Dock my laptop when I come home? Appreciate any suggesitons

    That depends on what kind of "files" you're talking about and what your employer's policy is on using cloud storage.
    I found dropbox and/or OneDrive work very well for keeping documents in sync between multiple machines.

  • What is the best way to transfer files without iTunes?

    Long story short, my computer died and I now do everything on my iPad. I am having trouble figuring out the best way of juggling files so I can print them though the school computers. I don't even know if I can email it as an attachment. Most of the files are from pages, keynote, or pictures. How do I store it so I can open it on another computer. I would like to use a flash drive but there is no USB port on the iPad.
    Thanks for your help! I am new at this.

    You can email the files. When you are in Pages - with the document open - tap the Wrench Icon (tools) in the upper right corner and tap on share and print - then tap email document in the next window. Your mail app will popup and you can email the file and save it to your school computer then open and print it. The process works the same in the photos app - select the photo - tap the arrow icon in the upper right - tap email photo. Keynote should work the same way - I don't have Keynote.
    DropBox - as Rudegar explains would also work. You will have to download the app on the iPad and use it on the school computer as well - you can get a free account for up to 2GB from DropBox - but I don't know if the school will allow you to download the application on your computer. The application for the computer is free as well.

  • Whats the best way to transfer everything from my old macbook pro to a new mac mini, i have a external hard drive which i backup to regularly via time capsule

    whats the best way to transfer everything from my old macbook pro to a new mac mini, i have a external hard drive which i backup to regularly via time capsule

    Check out > OS X Lion: How to use Migration Assistant to transfer files from another Mac

  • Best way to transfer files from old Macbook Pro to new one?

    I just got a new Macbook Pro from Apple...YEEEEAAAHHHH! 
    So....
    What's the best way to transfer files from old Macbook Pro to new one?  I know Migration assistant, but is there a recommended way?  I don't want to put do a system restore or transfer everything from the old laptop, but I do want to move important things like photos, music, documents and such over.  Any suggestions on best way to do this?
    Another question, perhaps subquestion.  If I have, say, an older version of iPhoto but a newer version of one on my new Macbook Pro, will it still transfer photos no problem?
    Just looking for hints from the experts so this puppy is set up in the best way possible.

    Just one comment on this:
    ‘If I have, say, an older version of iPhoto but a newer version of one on my new Macbook Pro, will it still transfer photos no problem?’
    the problems are ALWAYS in the reverse way, when you have the newest (or a newer) version of a given app, and wish to transfer its library to an older version.
    Otherwise, see the link to Pondini.
    I have been using Martin Jahn’s iBackup, with which I have become accustomed and works fine. It also makes daily backups. Its advantage over other apps is that you may add whatever you wish to save, beside its default settings (which you may delete or cancel, of course, even if not recommended); it also has a friendly interface and easily customizable. Of course, this is a personal view, you may try other methods as well, or other backup apps. All are good if you are satisfied and correspond to your needs.

  • [vmware] Best way to share files between host and client

    Good afternoon!
    I have successfully installed VMware server on my machine and set up a virtual machine, powering Windows XP for study issues (emulation via wine does not do the trick for me). The virtual machine runs fast and stable but does not meet my requirements unless I have two issues faced:
    First:
    How to access a USB pendrive monunted by the host system properly within the client?
    Second:
    What is the best way to share file system space between host and client? Should I set up a Samba share which is accessible for both host and client or is it save to grant my VM access to my physical hard disc as a whole (using it as a partition)?
    Thanks for answers in advance, I have still quite a lot to learn, when it comes to VMs.
    Regards,
    ~cg

    Do not setup your VMware to be able to access your physical disk as a whole. This would have you mounting the filesystem twice, corrupting it in the process.
    You /can/ setup VMware with Sharing Folders that lets you share your filesystem (either / or just /home or something else) and that is what I would recommend.
    As for accessing the pen drive from both operating systems at once, I'd say use the same Sharing Folders method. I always share /mnt so that I can access my cdrom/USB/etc from the vmware OS.
    The sharing folders is basically the same as a samba share, but uses vmware's own method (HGFS). Samba is more secure (if you are worried about your VMware OS breaking from it's shell and attacking your real filesystem, which is unlikely). You need the vmware tools installed to make use of it.

Maybe you are looking for