Only setX() can rollback, ejbCreate() can not

Hi ,
I need your help on the strange error . I create a stateless EJB to call 3 entity bean's function , like this :
function insertInventory() {
try {
//first get the bill no.
ejbBillNo.setNo(ejbBillNo.getNo() + 1 ) ;
//then insert header table :
ejbHeaderHome.create(valueData) ; //run successful
//finally , insert details
ejbDetailHome.create(valueData) ; //will throw a SQLException
//by some sql error such as
//foreign key violation
catch (Exception ex) {
sessionContext.setRollbackOnly() ;
throw new EJBException("error") ;
//end of function
ejbBill , ejbHeader , ejbDetail all are bmp , and all the method require transaction . so , when SQLException throwed by detailHome, all change in the session function will be rollback . But it not , ejbHome has insert a record to database permanently! and ejbBillNo , ejbDetail has been rollback !
why does this happend?
I use Weblogic 6.1 as app server and web server , MSSQL as database server . Preciate for your advice .
Best Regards
lcl

I think the problem is that each EJB call has it's own transaction. Sounds like you want a user-transaction. A user-transaction will allow you more control - the downside is that you have to remember to commit. Here is some code examples (note: this was for EJB 1.0 -lookups are probably different)
UserTransaction utx = null;
Context jndiCtx = null;
String badMessage;
boolean needException = false;
try {
   jndiCtx = new InitialContext(System.getProperties());
   utx = (UserTransaction)jndiCtx.lookup("javax.jts.UserTransaction");
catch (NamingException ne) {
   throw new AppNamingException(ne.getMessage());
try {
    utx.begin();
        do some stuff
        if necessary, set needException flag and badMessage string
    if (!needException) {
        utx.commit();
    } else {
        utx.rollback();
        throw new AppCommitException(badMessage);
catch (Exception e) {
    throw new AppExecutionException(e.getMessage());
}

Similar Messages

  • Paypal will not display pictures (text only). Can not buy things on the internet. Can not upgrade flash in firefox.

    3 problems: 1) I can't buy anything online. Firefox has a popup that states that all payment sites (Amazon, paypal, etc.) are forbidden and tries to protected me from them and blocks me (will not let me bypass the block). 2) Once I figure a work around the block Paypay shows as text only (shows all content on internet explorer) 3) try to upgrade adobe flashplayer as suggested in a forum and adobe flash can not upgrade when firefox is open. Been on firefox for several years now why the sudden ultimate security?

    Quite honestly, I think you need to go back to Flash 10.3.183.90, a version that was kept alive specifically for WinXP users. The Flash 11 and later versions have a separate plugin container that isn't available for anything below Win Vista with feature you can't even use. I see no advantage to anything newer and on the down side the newer versions are a lot more likely to crash frequently.
    First, grab the Adobe uninstaller from here:
    http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html
    Then download Flash 10.3.183.90 from here - about halfway down the page:
    http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html
    (Released 6/11/2013) Flash Player 10.3.183.90 (61.1 MB)
    IMO, the best version of Flash for WinXP. Adobe kept up with security updates for 10.3 for WinXP users long after Flash 11.0 came out in 2011 for Vista and newer versions of Windows.
    Run the uninstaller, then reboot your operating system.
    Then you can run the Flash installer, with Firefox closed, of course.
    ''Note, if you still use IE, you'll need to reinstall the ActiveX version of Flash for IE. That uninstaller removes all versions of Flash that might be installed,''

  • Help me! can not ping through hostname

    Hello
    i am using Solaris 8. I can ping and reach the other host by IP only,
    I can not reach the other host by the DNS name. How can i overcome
    this problem. shall i do any configuration .Help me to resolve the problem.
    Thanks in advance,
    balachandar.

    Hello,
    Modify /etc/nsswitch.conf file to include dns and not inly files in the hosts line. This way you tell Solaris to use both naming services, files and dns (there is a template called /etc/nsswitch.dns). Also you must put your dns servers�s IPs at /etc/resolv.conf. The sintaxis is:
    nameserver XXX.XXX.XXX.XXX
    nameserver YYY.YYY.YYY.YYY
    nameserver ZZZ.ZZZ.ZZZ.ZZZ
    Bye,
    jmiturbe

  • Why button can not call its script?

    I did very simple work: open Director MX 2004, click the
    button icon on the Tool Palette, and draw a button on the stage.
    Right click it and menu appear. Click "Scripts..." and script
    window opens. MouseUp() event function is there already. Write
    something in mouseUp(). Anything is OK. Put a breakpoint on some
    line.
    OK, then click menu Control-Play to run the movie. Click the
    button on stage. At this time, it ought to be broken on the
    breakpoint. But it didn't. The mouseUp() was not called!
    On the other hand, other controls are OK, such as Text,
    Shape, etc.. Only botton can not call its script. Is it a bug of
    Director MX 2004?

    It may be that you're creating flash component buttons. Try
    setting the tool palette to 'classic' mode (the dropdown at the top
    of the tool palette). The buttons you create once you've done this
    will be native director buttons.
    I've not really used flash component elements much at all so
    I can't offer advice as to why the mouseup isn't working with it.
    - Ben

  • I can not rotate the screen writing a sms to write it horizontaly.

    I have a one touch fire Alcatel and when writing an SMS can do it only verticaly, can not rotate the screen
    to write it horizontally.
    I would like to know id it may be a software problem ir just cant do it.
    Thanks.

    Hello!
    This function is currently not available in Firefox OS for the Messages Application. We are working towards to making this available. At the same time, you can file a bug for this feature to be made if somebody hasn't done so already. You can file a bug here: https://bugzilla.mozilla.org
    Please report back with the bug number or a link to the bug so we can keep track.
    Thank you!

  • Satellite R630-11L - can not install Windows XP SP2 Prof

    I removed ald Hard disk -> insert new (SATA) Hard Disk -> Insert CD Windows XP SP2 Prof into DVD Driver -> Power Off.
    The Power On -> Laptop reads CD Windows XP SP2 -> Installation process
    But at the end, only "bluescreen": can NOT install (the CD ist already installed successfully for another old laptop.
    I have 5 times to try.
    Who has done successfully ?
    Thank a lot!

    I have a L650-PSK2cu that was a real hassle to get the drivers installed properly, but that was because I installed INTEL HD video drivers BEFORE the AUDIO and it made the installation of AUDIO drivers impossible. I had to do afresh install a second time. Once I did the 2ND fresh install and installed the COnexant Audio Drivers BEFORE the INTEL HD Video drivers it worked great. Live and learn. This machine with XP PRO runs 10 times better than Win 7 64 BIT. XP WON'T die for a while. I just hope people are archiving drivers before they become unavailable.
    Make sure if you have anewer chipset intel i3,i5,i7 etc... tha you set the bios to compatibility mode if possible as well.

  • Have updated from Snow Leopard to Lion with Safari Version 5.0.5. Now I can not update to Safari 5.1. There is no update in the Software Updater, and on the apple-download page, I only found a Safari 5.1 for Snow Leopard. When executing it, there is an e

    I have updated from Snow Leopard to Lion with Safari Version 5.0.5. Now I can not update to Safari 5.1. There is no update in the Software Updater, and on the apple-download page, I only found a Safari 5.1 for Snow Leopard. When executing it, there is an error message, that it is for 10.6 only.
    It seems that I should have first updated Safari, and then only to Lion, which I didn't. Any idea how I can fix this now without having to rollback to Snow Leopard, update Safari and then go back to Lion?

    Try this Safari5.1 from the installer package
    http://www.filefactory.com/file/cc9005d/n/Safari.pkg.zip
    The download worked better with Firefox not sure why. At the bottom of the page after the captcha>> slow down load is the Free link,  it took about 4 minutes to download on my test.

  • How can I get ALL of my Google Calendars to show on the iCal on my iPhone? I see all of my Google Calendars on the iCal on my Mac, but I do not see them in the iCal on my iPhone. I only see one Google Cal, but not the others.

    How can I get ALL of my Google Calendars to show on the iCal on my iPhone?
    I see all of my Google Calendars on the iCal on my Mac, but I do not see them in the iCal on my iPhone. I only see one Google Cal, but not the others.

    https://www.google.com/calendar/iphoneselect

  • On my macbook pro when opening a page i can not save it as a pdf only give me the option of saving it as a web page can any body help me on this I have tryed so many times without success

    on my macbook pro when opening a page on safaryi can not save it as a pdf only give me the option of saving it as a web page can any body help me on this I have tryed so many times without success?

    Just select Print in Safari and then, in the bottom left-hand corner, select PDF and you can save it to whichever flavor pdf file you like.
    Clinton

  • Can not scan from mx4890dw buttons, only from the computer

    Hello,
    I got this Canon AIO a few days ago. I followed the start up guide instructions, got it signed on to the wireless net work easily enough, and installed the software from the CD onto a Win 7 64 bit Dell laptop.
    Printing worked perfectly from the get go. Also, "Copy" seems to be working fine. Fax appears to be working, although I can't confirm yet that a fax has gone through ( no one is at work ) and I may have some questions later about how to send and receive fax when sharing a phone jack with a Comcast modem/cable set up. And how to get it to accept faxs while ignoring voice calls.
    As for Scan, after I figured out that I had to push the scan button and choose "remote scanner" ( I push the scan button/Remote scanner/ buttons, get the message "waiting" and then operate from the computer) the scan function worked perfectly, in single and duplex, when controlled FROM the computer and Canon MFC toolbox software. But for the life of me I can not get it to scan from the Canon mx4890dw buttons. I push Scan, then "computer", then I select my computer ( there is only one computer), then either color or BW scan. All seems OK until here. But after I select color or BW,  I get a screen that says :"Scanning" with the choice to either cancel or "confirm destination". I select Confirm destination, which then takes me to a screen which says: Confirm destination" showing both the name of my computer and "color scan". That is it, as far as I can go. If I press "OK" it just takes me back to a choice of confirm or cancel. I am trapped in a cycle between these last 2 screens. Once I get to the next to last screen that says "Scanning: cancel or confirm destination", the processing data light starts flashing green. After a minute or so it will stop flashing with the message "an error has occurred/CLOSE". Oh, BTW, I have registered the scanner on the Canon MF Network Scan Utility.
    So, I figure there is some button I am failing to push, or I am missing a step. Any one have any ideas on how to get this to scan from the Canon machine?
    Thanks
    Bill

    Thank you Deborah, but after many hours of trial and error, time spent with Norton 360 AV/Firewall folks, many install/uninstalls ( especially after I saw on the E-manual that if you plug a cable from the printer into the computer, and you want to go back to wireless, you must uninstall/reinstall the software), the problem is finally apparently completely solved.
    I found what I thought might be the problem by accident. When I last got off the phone with Canon, all they had to suggest was that it was either a Norton or firewall issue, or possibly a computer issue, and nothing they could really do or suggest about that. I accepted this, but while wondering what in the world I was going to do, it dawned on me that my previous Kodak all in one( that this machine replaced) had worked fine, with no scanner problems at all, with this computer, Norton and network. So it seemed like it had to be something other than those things. And I believe a Canon inkjet all in one before the Kodak had also worked with no issues scan wise.
    Then I decided to try something else on a whim: I cranked up my old Acer Win XP and installed the software, and guess what happened? Perfect function in all ways from the printer/scanner. Scanned perfectly from the Canon using the panel buttons on the printer. And over the wireless network on an old computer using the same Norton Firewall as my Dell. So it now seemed impossible that it could be the network or firewall. It had to be the only variable, the computer or someway the canon was in conflict with the Win 7 Dell. I bet you can see where this is going! So I go to the online support for Canon and sure enough there are Windows 7 drivers for download as well as a firmware update. So I down load these and clock on them, but as far asd I can tell, nothing happens. It appears they did not complete installation.
    So the next day I am back on the phone with Canon. Asking in desperation if they can think of anything before I return this machine back to Staples and get something else, which I really hated to do, but I can't take any more of this, as now it had stopped printing also( but all still hunky dory on the Acer!). But this time, the person I am talking to quickly asks if I am trying to install wireless, and says "hold on while I get you to the wireless guys". The wireless expert listens to my problems and quickly says "did you download the Win 7X64 driver?". I said I had tried but it didn't seem to do much. So he has me download it again and shows me the trick: when you click on the download, it creates a folder somewhere else where the driver is actually stored. I click on that driver, and 10 minutes later all is working perfectly. In fact, before I even hang up with the wireless guy, I press the buttons on the Canon and scan quickly to the computer.
    So for now all seems perfect, just as it was immediately once I tried it on the Windows XP machine. So I suggest that this be the first thing suggested when folks are having trouble installing on a Win 7 computer. In fact, I have since noticed there is a sheet of paper that came with the canon that advises downloading drivers for Mac computers. Too bad it didn't mention this for for Win 7 also, since apparently at least some of the installation CDs don't include these drivers.
    Now I am wondering if I should try and do the firmware update? Kind of afraid to fix what ain't broke.
    Bill

  • HT1349 I can not run the scanner in my main user, but only the second user and the same thing with updating apps! Why is this happening???

    I can not run the scanner in my main user, but only the second user and the same thing with updating apps! Why is this happening???

    Welcome to the Apple Community.
    Enter the details of her second account at system preferences> mail, contacts & calendars.

  • I can not send email from my iPad .  Have been using it for over a year, all of a sudden I can only receive email.  I have a wifi connection in my home and have a A T &T cellular data plan?

    I can not send email from my iPad .  Have been using it for over a year, all of a sudden I can only receive email.  I have a wifi connection in my home and have a A T &T cellular data plan?

    I have a 1st gen iPhone that I just updated the software to 2.0.2
    Now whenever I press the mail icon it goes to the mail app for about 4 seconds, does nothing, no loading of folders, old messages, nothing.
    Then it reverts back to the home screen. Tried restarting, haven't tried restoring, thought I'd look here first.
    Anyone???

  • I have been using my Apple ID in India and recently i moved to Spain and now i can not see my indian apps.it says my apple ID is valid for only spanish store.how to download apps from Indian store being in Spain.

    I have been using my Apple ID in India and recently i moved to Spain and now i can not see my indian apps.it says my apple ID is valid for only spanish store.how to download apps from Indian store being in Spain.

    Did you try to change the location  in Settings/iTunes & AppStore/AppleID -> view Apple ID, log in ->Country/Region -> India?

  • Hi I would be grateful if someone can help me, I have just bought a canon wireless printer, I only have an iPad so I can not install the cd that comes with the new printer yet it says it is compatible. How do I get it working I have a pay as you go 3G sim

    I do not use the Internet using wifi I use 3G mobile broadband and if I do need wifi it tells me I have to pay for it, but I can not work out how to install or connect my iPad with my new printer if there is not a cd slot or USB port. I only have an iPad no computer so how on earth do I use my printer with it if it I can't install the printer cd. I though I would be able to use Bluetooth and it would pick it up automatically but I am really confused now and don't know what to do please help.

    The iPad uses AirPrint technology to print to a printer. Check this Apple support page to see if your printer is listed as being AirPrint compatible.
    http://support.apple.com/kb/ht4356
    If your printer works with AirPrint you will need a Wi-Fi network in order to connect. That Wi-Fi network does not need to be connected to the Internet. As James Ward4 says, you'll need a Wi-Fi router to set up your network. Most routers require that a computer be used during the setup process. Perhaps you could use someone's computer to do the setup if you do not had one yourself. Once the router is set up you should be able to print.

  • HT1386 how can i get all of my music transferred to my iphone? only itunes purchased songs will transfer, not my whole library.

    How can i transfer my itunes music library to my iphone? currently it will only transfer itunes purchased songs and not my whole library.    

    For non-purchased music like CD rip music, or website downloaded songs, you need some third party software to copy the music from iPod to mac. If you need details, here is a guide about how to get music from iPod to macbook. Hope it helps.

Maybe you are looking for

  • Problems in balances of Tx. FS10N

    Hi everyone, I have problems with FS10N transaction. The amounts of the debit shows in the credit column and viceversa. Another problem is that the amount of debit is shown with negative sign , when actually has to be shown with positive (+). Thanks

  • Album artwork not getting on my iPod nano?!

    I tried everything to get my artwork to show up on my iPod nano. I read every topic in the forums about it and I did what people said to do and it still isnt showing up. The album artwork shows up in iTunes but not on my iPod. Can anyone help me?

  • Showing results on TV  - Reds are Exploding... what to do...

    I'm putting together a slide show/movie - All looks well on the laptop. but when I show on a TV the colors esp. the reds just explode... What to do? Thank you I'm sure it's something to do with the differences... and a simple setting but I can'f find

  • HELP: Cant view webpages but can download

    edit: nevermind, a router reset solved this

  • Premiere Pro 1.5 crashing on startup

    Windows XP Corporate Edition SP2 2.83 Ghz Pentium core 2 quad 896 mb Gigabyte Geforce 260 Canopus DV-Raptor editing card So, I work as a contract wedding video editor from home, and the company I get contracts from requires me to use pro 1.5.1 with a