When to use the EJB tier?

Could someone explain in simple and general terms when, say for a brand new application, you should or should not use the EJB tier over retaining everything in the web tier? Obviously it will depend on what the application is, but how so?

I generally use EJBs when i want propper transactional support in my webapps as you get lots of stuff thrown in ejbs thats saves me having to write code.
There are loads of reasons why you should / shouldnt use ejbs though so have a look at these for a bit more info.
When to use EJBs :
http://www.jguru.com/faq/view.jsp?EID=126400
or alternatively .....
When not to use EJBs
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=11&t=006707
Hope thats helps.
Gaz.

Similar Messages

  • I got ClassCastException when i use the Webservice Deployeble Client.

    hi, i created a webservice deployeble client. when i use the proxys i got ClassCastException
    here it is my code
    Context ic = new InitialContext();
                   out.println("----1---");
                   Object lookuped =
                        ic.lookup(
                             "wsclients/proxies/sap.com/ClientProxyDefinition/in.mobileone.demo.proxy.WSClientProxy");
                   out.println("\n----2---"+lookuped.getClass());     
                   PortableRemoteObject objPortableRemoteObject=new PortableRemoteObject();
                   out.println("\n---3--
                   Object narrowed =
                        objPortableRemoteObject.narrow(lookuped, AdminOperWS.class);
                   out.println("\n---4--" + narrowed);
                   AdminOperWS service = (AdminOperWS) narrowed;
                   out.println("----5---" + service);
                   AdminOperWSViDocument client = null;
                   ClsSuper objClsSuper = new ClsSuper();
                   String strErrorCode = null, strErrorMessage = null;
                   client =
                        (AdminOperWSViDocument) service.getLogicalPort(
                             "Config1Port_Document",
                             AdminOperWSViDocument.class);
                   out.println("----5---" + client);
                   objClsSuper = client.createUser("2", "lakshman", "lakshman", "ad");
    i got the output:
    1-----
    2-----class in.mobileone.demo.proxy.AdminOperWSImpl
    3----
    java.lang.ClassCastException
    plz send solu...
    Thank U

    Hi Lakshman,
    can you please elaborate how you are calling this web service( where you get the stub?)
    Why are you using these lines?
    PortableRemoteObject objPortableRemoteObject=new PortableRemoteObject();
    out.println("\n---3--");
    Object narrowed =
    objPortableRemoteObject.narrow(lookuped, AdminOperWS.class);
    out.println("\n---4--" + narrowed);
    These are used mailny for CORBA objects( while calling EJBs).
    Just remove these line and try.
    Please do come back with the output.
    Regards,
    Piyush

  • When I use the new Pages on my iPad, I can't open it on my new computer. It tells me that I must download the new Pages to see the Pages document, but when I try to download the new pages to my computer it tells me all apps are up to date.

    When I use the new Pages app. On my IPod  to type documents, I can't open them on my new computer. It sends me a message that I have to download a newer version of pages to see the Pages document. When I try to do that it tells me all my apps are up to date and will not allow me to upgrade the pages on my iMac.
    Any suggestions?

    What level of OS X is installed on your Mac (your profile is incomplete)?
    Barry

  • I have a Macbook Air with Mountain Lion..I upgraded to the latest version called Mavericks OX now it crashes a lot...when I use the shift key especially I now have version 10.9

    I have a Macbook Air with Mountain Lion..I upgraded to the latest version called mavericks ox now it crashes a lot...when I use the shift and Caps keys especially. I now have version 10.9. how can I get mountain lion back and get rid of this update?

    all of my software was current before i upgraded to maverick....i don't know why this is going on...any help?

  • I want to buy a hard case for my macbook pro, but I don't know what year it is. When I use the serial number to try and find out, all it says is, "~VIN,MacBook Pro (15-inch Glossy)". When I type that into amazon for a case it gives me nothing!

    I want to buy a hard case for my macbook pro, but I don't know what year it is. When I use the serial number to try and find out, all it says is, "~VIN,MacBook Pro (15-inch Glossy)". When I type that into amazon for a case it gives me nothing!

    Hi T,
    Either of these will give you the info you seek:
    http://www.appleserialnumberinfo.com/Desktop/index.php
    http://www.chipmunk.nl/klantenservice/applemodel.html

  • When I use the shortcut to open a new window in safari (command N), I get a 404 error message from Google. How do I change where 'Command N' routes to?

    When I use the shortcut to open a new window in safari (command N) on my Macbook Pro, I get a 404 error message from Google. How do I change where 'Command N' routes to? 

    It's not necessary to change the Command N keystroke..
    From your Safari menu bar click Safari > Preferences then select the Privacy tab.
    Click:   Remove All Website Data
    Then delete the cache.
    Open a Finder window. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari to test.
    If that didn't help, troubleshoot Safari extensions.
    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
    If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.

  • With my i phone 4 , the Push notifications doesn't work for apps like (fb viber , whatsapp etc ) it only works for the official apps like message  even when im using the phone, has  this probleme with the iOs 6.0.1 and also with the iOs 6.1

    With my i phone 4 , the Push notifications doesn't work for apps like (fb viber , whatsapp etc ) it only works for the official apps like message  even when im using the phone, has  this probleme with the iOs 6.0.1 and also with the iOs 6.1

    This isn't an issue. Notice the screen prior to the one that shows usage has an iCloud section and a Manage Storage button. For this button to activate ios needs to download a few kb from icloud. Switching back to this screen forces ios to download those few kb.

  • I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    Hi,
    You have 2 solutions:
    1 - You can use 2 differents icloud account
    2 - You use the same account but you don't sync yours contacts.
    You configure that in  Settings > icloud
    You activate or desactivate what you want.
    Have a nice day.

  • How can I make the background one solid color?  It is too difficult and noticeable when I use the retouch button and try to erase all the creases in my backdrop.  So, how can I have just a solid white background?

    How can I make the background one solid color?  It is too difficult and noticeable when I use the retouch button and try to erase all the creases in my backdrop.  So, how can I have just a solid white background?

    When talking about a specific image posting the image may be useful.
    One can use a Layer Mask and add a white Layer underneath.

  • IPhone shuts off when I use the internet on the 3G network & I can't upgrade/restore because of network connection error. Any Help?

    A few months ago, while on the 3G network, my iPhone 3GS starting turning off randomly when I was using safari or an online app and the battery was somewhere around 5-20%. When this happened the only way to get the phone back on was by fully charging it which sometimes took a few hours even. It wasn't a big deal at the time because it was infrequent and while the phone was at a low battery %. However, in the past few months, around the time I upgraded to iOS 5.1 it started happened more and more often and at higher and higher battery percentages. It is now at a point where my phone shuts off every time I connect to the 3G network regardless of what my battery life is. I have called Rogers several times to complain about this and I have been told it is because of the battery for the most part but I don’t buy it; the problem has got to be more significant than the battery alone because I can listen to music and send texts at anytime and fully use the internet when I am connected to Wi-Fi. I more recently talked to someone in tech support from Rogers who said my phone cannot support the iOS 5.1 software and that is why it is crashing. They also asked if my phone was heating up more now than in the past and it is. They said this was further evidence that my phone was couldn't handle the new software and was basically on overload.  I was told to the best solution was to "Back Up" my iPhone then do a full "Restore". Here is where my next problem comes along. I cannot "Restore" my iPhone without doing an upgrade and every time I attempt to "Upgrade & Restore" an error message pops up that says "There was a problem downloading the software for the iPhone "...". The network connection timed out/was reset. -Make sure your network settings are correct and your network connection is active, or try again later". I have followed all of the protocol that is readily available online to address this problem but still no success. I disabled my firewall and anti-virus programs, I have ensured my connection is active and stable, I have upgraded to the newest iTunes, I have uninstalled iTunes and all apple programs in the correct order then reinstalled iTunes, I have disabled my DNS cache. Nothing works.
    If you have any advise whatsoever please share as it would be greatly appreciated.
    Thanks

    I was actually able to upgrade to the newest software, iOS 5.1.1 without connecting to my computer/iTunes but rather directly through my phone when I was home on Wi-Fi. After the upgrade I plugged my phone into a different USB port at the back of my computer and was able to do a full restore. I really don't think the USB port had anything to do with it because I use the same front USB port all the time with my external hard drive and other devices wuth no problems at all; regardless of what the actual solution was, I am now able to connect to iTunes and upgrade/restore without any problems so that half of my problem is resolved.
    I have yet to leave my house since doing the upgrade/restore so I am not sure if the problem with my phone crashing when I use the interent on the 3G is still an issue. I will test it today and tomorrow and give you an update.
    Thanks

  • I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    Hi kamfong,
    Went to Settings where?
    If you want to use your exisiting Apple ID on your iPad, you need to:
    1.     Go to Settings>iTunes & App Store and sign out the new ID, and then sign on the old one
    2.     Go to Settings>iCloud, scroll to the bottom and delete the iCloud account, and the sign back onto iCloud using the old ID
    You still have not indindated why you are saying that using your old ID originally "didn't work". What do you mean by that? Did you get some sort of error when you tried to sign on with your exisiting Apple ID?
    Cheers,
    GB

  • Numbers does not open with the main user after installing mountain lion. It works flawlessly when I use the second account on my mac. What got corrupted in the admin-account, something in the user-library? How can I fix it? I´m kinda desperate...

    Numbers does not open with the main user after installing mountain lion. It works flawlessly when I use the second account on my mac. What got corrupted in the admin-account, something in the user-library? How can I fix it? I´m kinda desperate... (the same happens with the other iWork-Apps!)
    Looking forward to hearing from somebody with a littlemore expertise than me, Chris

    you can remove preferences files by navigating to the Preferences folder for your user as follows:
    0) Quit ALL iWork apps (Keynote, Pages and Numbers)
    1) from the Finder select the menu item "Go > Go To Folder…".  This will bring up a dialog:
    2) enter the path "~/Library/Preferences" (no double quotes)
    3) find the files:
    com.apple.iWork.Keynote.plist
    com.apple.iWork.Numbers.plist
    com.apple.iWork.Pages.plist
    and move these to the trash.  I would NOT empty until later.
    4) restart Numbers

  • I have an apple ID which I use to sign into icloud for my iPad and iPhone.But when I use the same ID for setting up iCloud on my Macbook it says INCORRECT ID or password, try again. I tried changing my passwords but it does not work for the macbook.

    I have an apple ID which I use to sign into icloud for my iPad and iPhone.But when I use the same ID for setting up iCloud on my Macbook it says INCORRECT ID or password, try again. I tried changing my passwords several times but it does not work for the macbook.

    You will have to provide the correct password to delete the existing account, if you have tried but are not getting the password reset email, contact Apple for assistance by going to https://expresslane.apple.com, then click More Products and Services>Apple ID>Other Apple ID Topics>Lost or forgotten Apple ID password.

  • How can I stop Firefox from changing Tabs/pages when I use the up/down arrows for scrolling?

    A recent update is causing the browser to switch between tabs, or even go on to other pages, when I use the keyboard navigation arrows to scroll down the page. This is aggravating, especially when filling out a form, which can submit before completion. The tab switching occurs mostly when the focus is not in a specific portion of the web page, such as when I have selected a tab. I I can find no way to disable this behavior.
    Win 7 Ultimate fully patched, Firefox version 35.0.1

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Occasionally when filling in forms in Safari 5.1.2 certain keys on the keyboard don"t work.  When I use the coma it opens up another tab.

    Occasionally when filling in forms in Safari 5.1.2 certain keys on the keyboard don"t work.  When I use the coma it opens up another tab. I've used other browsers to fill in the forms and they work fine so my keyboard is OK.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is localized to your user account, or is system-wide. Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select “Help” from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Any application you run will behave as if you were running it for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    As Guest, launch the application(s) and test. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.

Maybe you are looking for