Question about implement the transaction in EJB

Dear Sir
I try to do some transaction work in EJB,I builded 6 bean blow
OrderMgr(session bean) control Order(CMP Entity Bean)
Istock(session bean) control Item(CMP Entity Bean)
DeliveryMgr(session bean) control delivery(CMP Entity Bean)
I try to implement the transaction in session bean OrderMgr Like
public void submitOrder(int id) {
Try
Istock.dosomething
Delivery.dosomething
Bookorder.dosomething
catch (Exception ex) {
sessionContext.setRollbackOnly();
But not Rollback not work
Then I change Session Bean OrderMgr to BMT,write the code blow, but rollback still not work
sessionContext getUserTransaction().beging();
Try{
Istock.dosomething
Delivery.dosomething
Bookorder.dosomething
sessionContext.getUserTransaction().commit();
catch (Exception ex) {
sessionContext. rollback();
Could anyone tellme what's wrong with me code?
  

If you want to rollback work done by these methods, than you have to make sure that they don't start a new transaction. i.e. they should use tx attribute "required" or "mandatory".
Istock.dosomething
Delivery.dosomething
Bookorder.dosomething

Similar Messages

  • Question about JAX-WS together with EJB 3.0 on WLS 10.3

    Hi all,
    I am developing a application that it is running on WebLogic 10.3. The application expose EJB 3.0 methods as web services by @WebService & @WebMethod annotation. And my question is,
    1. Is there any way to specify the context path/root for those exposed EJB? Currently the contextpath is same as the EJB's name
    2. And is there a method to disable the "scanning" of JAX-WS annotation on startup/deployment? The reason behind is that, some of the EJB jar files are coming from other team. I need to deploy it as EJB but not as a web service.
    Thanks
    Regards,
    Rock

    Hi guys,
    Here is what Eduardo is talking about:
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=407022.1
    (Doc ID: Note:407022.1)
    Rgds,
    Fábio.

  • Question about Hibernate vs select query/EJB

    HI all
    i just want to understand the benefit of using Hibernate to map table to java object. normally we use select sql to get data and populate objects with the result set for simple situation, and if it gets complicated, we may use Entity Beans for persistence. now we have this hibernate concept that maps a table to a object, and use the hibernate APIs or queries to populate data. what is the big difference. the hibernate claims to be ultra high performance, any thought? thanks for your help and insight.

    I have to say I wonder whether EJBs are much use at all. I think we need to explicitly say entity beans here. I think SLSBs and MDBs are decent and will remain even if CMP entity beans fade.
    The EJB model says have a container because it takes care of a lot of things for you (e.g., distributed, transactions, threading, clustering, lifecycle, etc.) For those apps that don't need those things, don't use EJBs.
    They have the feeling of being one of those management-driven fads. I think it's more like Sun and the designers of EJB had an initial idea, EJB 1.0, that has turned out to be non-performant. EJB 2.0 tried to fix it with CMP. Still didn't work. We'll see if POJOs and ORM are the answer. Check back in five years. There's a lot to like, but I'm sure EJB 1.0 was the best effort by smart folks, too.
    When you come down to it the
    attraction seems to be the idea that you can use
    weaker programmers (and I doubt the reality of that,
    either).I don't think anybody ever said that. EJBs aren't trivial. The container relieves programmers from having to write their own transactions, threading, etc., but what's left is hardly "easy".
    Certainly they've got to be extremely costly on
    comupting and (more importantly) network power, and I
    find it hard to believe they really simplify coding.I think the cost on computing and network power are just part of writing enterprise apps, which is where the E in EJB came from.
    Lots of times the network problems come about because naive programmers do n+1 queries when n will do. Hibernate helps with that.
    %

  • Questions about using the Voice Memos app

    I'm currently an Android user, but will be getting an iPhone 6 soon. My most used app is the voice memos app on my Android phone. I have a couple questions about the iPhone's built-in voice memos app.
    -Am I able to transfer my voice memos from my Android phone to my iPhone, so my recordings from my Android app will show up in the iPhone's voice memos app?
    -When exporting voice memos from the iPhone to computer, are recordings in MP3 format? If not, what format are they in?
    -In your opinion, how is the recording quality of the voice memos app?

    You cannot import your Android voice memos to your iPhone's voice memo app.  You might be able to play the Android memos and have the iPhone pick up the audio and record it.
    Here is the writeup about sending voice memos from the iPhone to your computer (from the iPhone User Guide):
    App quality is excellent.

  • Some question about communicating the usb RAW device

    I have some question about USB communication: I want to make my VI communicate
    TI-DSP by USB, now, the driver of USB on DSP have done, and  there are a test
    program writen by VC and a driver fold(with a .inf and a .sys files), when I
    install the driver and run the test program, the driver program on DSP run
    regularly. And then I want to program a VI which have the same function as the
    test program, so I unload the driver on PC firstly, then install the DSP in
    NI_VISA according to "Using NI-VISA 3_0 to Control Your USB Device - Tutorial -
    Instrument Drivers". When I sent the standard control request using the VISA test panel, the status below happened. I don't know what wrong with my step.
    Dev  Phase  Data                       Info           Time   Cmd.Phase.Ofs    
     15  CTL    80 06 03 00 - 00 00 04 00  GET DESCRIPTR  5.2sc        56.1.0       
     14  CTL    80 06 03 00 - 00 00 04 00  GET DESCRIPTR   11us        57.1.0       
     14  USTS   00 00 01 c0                canceled       2.0sc        57.2.0       
     15  USTS   00 00 01 c0                canceled         5us        56.2.0 
    PS: the software I use to capture the data is BUSHOUND
    1、Do I have to install the .sys driver file in VISA? How can I install the driver file without losing the device in MAX?
    2、Someone told me it must be done by calling .dll fies in LV, but I want to know if LV can program the function directly without calling .dll file?
    Thank for any reply~~!

    逍遥浪子 wrote:
    I have some question about USB communication: I want to make my VI communicate TI-DSP by USB, now, the driver of USB on DSP have done, and  there are a test program writen by VC and a driver fold(with a .inf and a .sys files), when I install the driver and run the test program, the driver program on DSP run regularly. And then I want to program a VI which have the same function as the test program, so I unload the driver on PC firstly, then install the DSP in NI_VISA according to "Using NI-VISA 3_0 to Control Your USB Device - Tutorial - Instrument
    Drivers". When I sent the standard control request using the VISA test
    panel, the status below happened. I don't know what wrong with my step. Dev 
    Phase 
    Data                      
    Info          
    Time   Cmd.Phase.Ofs     --- 
    -----  ------------------  15 
    CTL    80 06 03 00 - 00 00 04 00  GET
    DESCRIPTR  5.2sc       
    56.1.0         14 
    CTL    80 06 03 00 - 00 00 04 00  GET
    DESCRIPTR   11us       
    57.1.0         14 
    USTS   00 00 01
    c0               
    canceled      
    2.0sc       
    57.2.0         15 
    USTS   00 00 01
    c0               
    canceled        
    5us        56.2.0  PS: the
    software I use to capture the data is BUSHOUND 1、Do I have to install the .sys driver file in VISA? How can I install the driver file without losing the device in MAX? 2、
    Someone told me it must be done by calling .dll fies in LV, but I want
    to know if LV can program the function directly without calling .dll
    file?
    This thread
    contains already a related answer and explains what a sys driver is.
    While you could theoretically use the Call Library Node to call all the
    necessary Win32 API kernel functions to connect to a device driver,
    this would be very cumbersome and not doable without a real good
    understanding about C programming. Writing an interface DLL instead
    won't need more C programming knowledge at all but will give you a
    clean interface to that device driver which eventually could be used in
    other programming environments as well.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Question about using the JBIBRIDGE in MIDM project

    I am in the process of implementing the ESB based MIDM. I am trying to use a JBIBridge in the process. I have 3 different projects that need to the PersonEJB in their JCD's. The question is do I use the same JBIBridge External Application in each of the connection maps? Then do I deploy those JBIBridges to the same JBIBRIDGE External System and add each of thos 3 deployment Profiles to the same Composite Application? Or do you create three seperate JBIBridge External Applications, Systems and Composite Application?
    John Bidwell

    Regarding calls when roaming internationally, the following was copied from this link.
    http://www.wireless.att.com/learn/international/roaming/faq.jsp
    When your device is on:
    Calls that you do not answer that are routed to the AT&T voicemail system will be charged as an international roaming incoming call to your device.
    In addition, the foreign carrier's routing of that call to the AT&T voicemail system may generate an outgoing call charge from your device's location to the U.S.
    These charges apply even if the caller disconnects from the voicemail system without leaving a message.

  • Question about rendering the page

    hi
    i have button on page 73 which this button brings me to page 74
    in page 74 i have a sqlquery report region,
    and another simple html region which have a button
    called "send_mail" there is a process which executed when i press this
    button and of course i did branch to this button which brings me to the same page 74
    my question is do the sqlquery report region run again when the page in
    rendering? or the apex save it as cache? and if not is there a way that it won't run again but stay in cache like"save state" ? cause i saw only conditional display and not conditional process of sqlquery report?
    the reason that i ask this cause the query is very heavy
    thanks in advanced

    Hello Naama,
    >> i wanted to ask if there any more things that i can missed because of this "old" version
    APEX is using the PL/SQL Web Toolkit extensively. I don’t really know the differences between every version, and I don’t think it’s matter. In some cases, a new version can fix some bugs (like in the rendering process), in others, can add new features (like caching) and in general, making the code better (optimizing etc.). So, I can’t really give you a list of things you are missing, but I can assure you that not using the latest version can damage/degrade the quality of your system.
    There is another problem with not meeting the pre-required installation terms, because usually people will assume you are. It can make debugging really hard. In your case, you were lucky that Scott asked you right away about the OWA version. Unfortunately, Scott is unique that way. Other (like you and me) can spent a lot of time trying to figure out why something is not working as expected, without knowing (remembering) that the only reason is a faulty infrastructure.
    Is there a problem to install the latest version of the PL/SQL Web Toolkit? As far as APEX concern, it will not harm your 1.6 instance, and should not damage any other database functionality, so why not upgrade?
    Regards,
    Arie.

  • Question about how the Robocopy /B switch works...

    I've been experimenting with robocopy recently, and most switches seem self explanatory for the most part; although I have a question about the /B switch.
    The help says the following:
    /B :: copy files in Backup mode.
    I've checked multiple forums and websites to try and elaborate on this a little more, and from my understanding this switch enables backup mode that essentially gives the ability to change the acls of a file/folder when the account running robocopy does
    not have sufficient privileges, to perform a successful copy.
    My question is, when the acls are changed when using this "backup mode" switch, with the /copyall switch, will the file still retain the same user access that it originally had - or does it change all of the security settings?
    I'm hoping it will somehow change the security settings, create a copy, and retain the same acls as the original - so users can still access necessary files.
    Can someone please explain how this "backup mode" works?
    Thanks in advance.

    This is a very useful thread with a lot of hostility in it.
    I have to agree with Jonathan and hazymat: there are few other forums that will discuss the exact function of /b switch, the TechNet article just says "copies in Backup Mode" (I have the article bookmarked), and when doing a google search, THIS page comes
    up as the top result! Kinda difficult to tell people they should go search, when you are the exact destination of that search, isn't it? ;)
    No offense to anybody working hard to help out here, but this is why sites like Stack Exchange will overshadow every traditional tech forum very soon. More concise question/answer format, more civil, and they actually encourage old questions developing new
    answers! All q&a is cataloged for future reference. Their focus is on being a 'resource'.
    The negativity here is unfortunate, you guys have great potential to be a very helpful resource for people. Who are you trying to be, the guys with all the answers, or the guys who say "get out of here, your answer isn't in here. Go search for it."?
    Regardless, many thanks to jrv! for helping me with my robocopy batch SCRIPT which I just used to create an automated backup! Take care boys. And yes, I just bumped your old-old thread.
    Unfortunately I think you miss the point.  RoboCopy is an application.  It is not a script.  This is a scripting forum.  Many people come here nd never read the forum guidelines and do not ask script related questions.
    The /b switch is documented in RoboCopy help.  Of course it assumes the reader is a trained Windows tech and knows what backup mode is.  It is used by nearly all backup software when backing up a live system..
    ¯\_(ツ)_/¯

  • Need to ask a question about getting the iPhone 5 without an upgrade available.

    Alright so I have currently an iPhone 4S and do NOT have an upgrade available. My question is how do i go about buying the 5 then? From what I know, Apple sells "unlocked" phones at around $750 (I want the 32gig version) but wont come out on launch day. Is there a Verizon specific phone that I can get instead of an "unlocked" phone that would cost cheaper and I can get it on launch day? Or do I have to preorder it through verizon's website?
    Another thing is...is there certain fee's that I would have to pay to go along with the phone if I can buy it?

    Pernoe: I'm no expert, but this is the way I understand unlocked phones. Unlocked phones that use GSM technology can work on either T-Mobile or AT&T networks. Unlocked phones that use CDMA technology can work on either Sprint or Verizon networks. I can't tell you the difference between GSM and CDMA... I just don't really know what it is, just that AT&T and T-Mobile use GSM and Sprint and Verizon use CDMA.
    That being said, I purchased (or at least ordered... my credit card has not been charged yet) 2 iPhone 5's from Verizon and opted to pay full price instead of taking the contract discount. You don't need to buy an unlocked phone to pay full price. You just have to select "month-to-month" pricing instead of "2 year contract" pricing when you buy the phone.

  • Questions about flashing the bios

    Hi everyone. I have a few questions about the process involved in a bios update.
    First, I should tell you I have a Lenovo G470 that sometimes has problems booting.
    The problem is I turn on the laptop and after 2-3 seconds it shuts down. I see the logo, and nothing else. After that I can spend hours trying to turn it on again, and keeps failing. After some time, I turn it on and use it without problems.
    Before these problems, I had experienced similar troubles, but I could fix it (in my way) and I explained it in this post: http://forums.lenovo.com/t5/Lenovo-3000-and-Essential/Lenovo-g470-shutdown-problems-in-intervals-of-...
    Ok, In that post a reply says that a possible solution could be a Bios update. So, I've been thinking to flash the bios to solve my actual problem, but I would like to ask you some questions:
    1. Updating the bios could be a solution for this case?
    2. How long does it take to update a lenovo G470 bios? (I ask this because I read that if a problem occurs in the middle the damage can be serious, and in the past I had these random shutdowns, so I'm a bit afraid)
    3. How am I sure if my bios is or not updated? (there's a way to check this from windows?)
    4. Finally, if you could give me a link to download the correct bios update I'll thank you.
    I think that's all. I apologize for my basic english and hope you could give me some clues on this, because, as you see, I'm a total newbie.
    Thanks!

    hi alemaneitor,
    Regarding your questions:
    1. Yes, flashing the BIOS may help solve your problem as it will re-write the configurations on the CMOS. Take note though of the changelogs or README (repair changes) as the latest BIOS updates fixes critical issues on the hardware.
    I've also seen some units that act the same as yours and doing a gpu reflow most of the time fixes the issue - see this thread in reference.
    2. In flashing the BIOS outside of Windows, it takes less than a minute. If you need to run the BIOS flash utility inside Windows, it may take 1-2mins.
    3. If there's a new BIOS that fixes critical issues, it's most of the time uploaded on the lenovo website (in some cases, BIOS updates are not available to the public and can only be used by service technicians)
    4. The latest BIOS update for the Lenovo G470 is the one below that fixes an issue on units that can not enter BIOS after restart under compatible HDD mode (see README.TXT)
    BIOS Update for 32bit Windows
    40cn33ww_32.exe
    3.28MB
    BIOS Update for 64bit Windows
    40cn33ww_64.exe
    3.67MB
    Regards,
    neokenchi
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Question about using the Combo Box feature!

    I have a form that I am trying to create for our company that will allow our field nurses to select what they need and print it more effieciently.  The problem is that some of the selections are too long and I can't get the Combo box feature to allow them to be printed on multiple lines:
    I have spoken to my supervisor about redoing the form to look like this:
    But in order for us to meet state guidelines it has to be formated like the first because that is the state form given to us.  I want to be able to either:
    A) have the combo box multi-line auto text sized so it will get all the information into each box
    OR
    B) create text boxes at the end of the form that auto enteries the selected data from the second picture into boxes that look like the first picture.
    Is there any way to do either of these?

    A) No.
    B) Yes. Create a text box with the following code as the custom calculation
    script (assuming the name of the combo is "Combo Box1"):
    event.value = this.getField("Combo Box1").value;
    That way, when the user makes a selection in the combo-box, the value will
    also appear in the text box. Just make sure to make the text box read-only
    and set the combo-box to apply the selection immediately.

  • About implementing the "add'" function in web dynpro

    hi guyes,
    now i want to implement the "add" function in the webdynpro. i bind a model node to the inputfields. and then i call the webservice ,but it does not work . the webservice is good . what happened to my project on earth? can anybody tell me what i should pay attention to in my code? my node structure is below:
    AddTicketworkhour==
       ticketworkhourbean
           name
           remark
       userId
    the root node is AddTicketworkhour ,it contains ticketworkhourbean and userId,    ticketworkhourbean contains name and remark.
    Thanks A Lot !

    public onActionSave(  ){
    wdContext.currentAddWorkscheduleBeanElement().setConsultantName("qinlei");
        wdContext.currentAddWorkscheduleBeanElement().setDistrictName(wdContext.currentDisplayElement().getName());
        wdContext.currentAddWorkscheduleBeanElement().setRowId(123456789);
        wdContext.currentAddWorkscheduleBeanElement().setLocation(wdContext.currentDisplayElement().getRowId());
        wdContext.currentAddWorkscheduleBeanElement().setWorkerId(12345678);
        wdContext.currentAddWorkscheduleBeanElement().setWorkDate(new Timestamp(wdContext.currentContextElement().getWorkDate().getTime()));
         wdContext.currentAddWorkscheduleElement().setUserId(100);
        boolean result = wdThis.wdGetMyWorkscheduleUICompController().addWorkschedule();
    wdDoInit( ){
    MyWorkscheduleAddModel addModel = new MyWorkscheduleAddModel();
                    AddWorkschedule addWorkschedule = new AddWorkschedule(addModel);
                    WorkscheduleBean addBean = new WorkscheduleBean(addModel);
                    addWorkschedule.setBean(addBean);
                    IAddWorkscheduleElement addWorkscheduleElement = wdContext.createAddWorkscheduleElement(addWorkschedule);
                    wdContext.nodeAddWorkschedule().bind(addWorkscheduleElement);
    Is there anywrong with my wdDoIt( )?
    谢谢!

  • Using the RK4 VI, had a question about implementation

    Here's a link to the system I'm approximating:http://i.imgur.com/EXnswBm.png
    The way it's going to be used, it will use current values to calculate values that will be important in the next iteration of a while loop. The values passed into it via the X0 input will be from the last loop iterate, and the values coming out will be sent into a shift register. The length of each iteration varies according to another VI, so it'll be flipping between 5 and 10 minute cycles.
    My question pertains to that max[] that's in the DE for I1(t).
    Since labview isn't a functional language, I know that whatever I put into the F(X,t) array will be interpreted as a string, and not parsed as a function. Since the max operates on one of the variables, I can't simply apply the max[] operation outside and just leave that space as a number, or a dummy variable.
    So is there any way to do this? Even a case structure wouldn't handle it, because it'd have to be applied for every iteration of RK4, and not just to the VI as a whole

    The fundamental issue is that max() is not a differentiable function so the system of equations is not one which RK would be expected to solve.  Any differential equation solver in LabVIEW or a text-based language will need to do something beyond the normal solving process to deal with the discontinuities created by max().
    If I2 is reasonably well behaved near zero, creating two sets of equations for I2 > 0 and I2 < 0 and switching based on the previous value of I2 might work.  It will be much slower because you will need to stop and start the solution process.
    The RK algorithms are documented in a number of references. It might not be too difficult to program your own with the max() function built in.
    Lynn
    You can insert images directly into your posts. Look for the tree icon in the toolbar above the message box.

  • Question about implementation of a webservice

    Hi
    I have successful implemented a webservice call in my webdnypro application. But I am not sure if I have done this the right way
    Scenario: I have a view which displays data from a business partner. These data can be accessed over a webservice. The webservice requires a parameter with the id of the bussiness partner.
    My solution: I have implemented a method in the component controller (*comp.java).
    public void getBusinessPartnerInfo( java.lang.String businessPartnerCode )  {
        //@@begin getBusinessPartnerInfo()
           service = new BPService();
           Request_GetBPInfo request = new Request_GetBPInfo(service);
           GetBPInfo getBPInfo = new GetBPInfo(service);
           getBPInfo.setCardCode(businessPartnerCode);
           request.setGetBPInfo(getBPInfo);
           try {
                request.execute();
           } catch(WDWSModelExecuteException ex) {
           wdContext.nodeRequest_GetBPInfo().bind(request);
        //@@end
    and I invoke this method from the wdInit method of the same controller.
    public void wdDoInit()
        //@@begin wdDoInit()
           this.getBusinessPartnerInfo("c1000");
        //@@end
    Therefor the data is available when the view is loaded. But I am asking myself if this is the right way to do that? Wouldn't it be better to call this webservice invocation from the init method of the view?
    Additionally I do not know at the moment how to access the environment of the portal for information. E.g. the business partner code c1000 is hard coded at the moment. I would like to read this code from the environment, e.g. the portal. Over which API can I access data from the portal or better say from the ume (where i can map a field to the business partner code)?
    Thanks for your answers,
    Thierry

    Hi,
    As far as your first question is concerned you can access the controller method from the view linked with the controller as follows:
    wdThis.wdGet<Contoller Name>Controller().yourMethod();
    I have no idea that you can store generic information such as BP code specific to a user in EP. Lets see.
    thanks & regards,
    Manoj

  • Question about modifying the Packet-based link into ASK modulation

    Hello everybody,
        Recently I learned the Packet-based link and I  modified it into ask scheme. But after I test the modified code, I find that it doesn't work as I image.
    I don't know why, can anybody help me about it?
        Thanks very much.
    Attachments:
    Packet-based Link(ASK).zip ‏445 KB

    I have a couple of questions that may seem silly, but...
    USB A = Windows DaRT 7.0 x86 for Windows 8 ISO burned
    USB B = Windows DaRT 7.0 x64 for Windows 8 ISO burned
    Is this a typo? You have it correctly above that where you list all 4 DaRT images, but not in the section I quoted.
    This TechNet article lists compatibility of DaRT versions:
    DaRT 8.1 supports Windows 8.1 and Windows Server 2012 R2.
    DaRT 8.0 supports Windows 8 and Windows Server 2012.
    DaRT 7.0 supports Windows 7 and Windows Server 2008 R2.
    DaRT 6.5 supports Windows 7 and Windows Server 2008 R2.
    DaRT 6.0 supports Windows Vista and Windows Server 2008.
    DaRT 5.0 supports Windows 2000, Windows XP, and Windows Server 2003.
    Also, did you use a Windows 8 ISOs with both DaRT versions? You need Windows 7 disks to create the DaRT 7 recovery disk.
    Let us know,
    Thanks
    David

Maybe you are looking for

  • How to get IOs from cDAQ9172 in LabVIEW

    HI - "Ladies" Can anybody tell me, what i´m doing wrong!  History: I´m using the cDAQ9172 with a few I/Os (9421/9472/9215/9263) I can see my hardware if i look in the M&A-explorer (i´m able to force the DIO to high and low) Question: What must i do t

  • Mysterious extra space used in Finder folder...

    I have a large AVCHD folder from a Canon camcorder.  I've copied the entire folder to two external hard drives.  One is an OWC Mercury Elite, the other a Western Digital My Book drive.  You have to copy the entire file, with all of the structure of i

  • Poor video quality when exporting hd

    I created a photo slideshow in iMovie HD. I used the hdv 1080i60 preset. when i preview it in iMovie the footage looks great. when I try to share it in an hd format(1080i or 720p) the movie looks really choppy. if i export it to a standard resolution

  • RawShooter registered email address changed

    My RawShooter registered email address has changed. How do I get my new email address to Adobe so I can receive my free download of Lightroom 1.0?Thank you...

  • In-house Cash in BW

    In order to have In-house Cash and AP reporting in BW I am going to Activate Treasury from Buisiness Content. (0TR). Is there anything else that I might need (except AP)?? Thanks my friends! Raamaaaaaa