Create method call

this.getDepartmentsLocalHome().create
(dept.getDepartmentId(), dept.getDepartmentName());
(the example from: http://www.oracle.com/technology/obe/obe_as_1012/j2ee/develop/endtoend/defaultejbscope/defaultejb.htm#t4)
does the create method called like that allow to insert a new record with all its attributs setted in the controller layer?? or should i define a new create which takes all the attributes as parameters?
thank u!

it s the first time i develop with EJB technology.
i dont know how to use the create method.
i m trying the following code to add a new row in myObject table:
public void addMyObject(MyObjectLocalDTO parametre)
try
MyObjectDTO obj = this.getMyObjectLocalHome().create();
obj.setAttr1(parametre.getAttr1());
obj.setAttr2(parametre.getAttr2());
obj.setAttr3(parametre.getAttr3());
obj.setRelationship_idmyobjectDTO(parametre.getRelationship_idmyobjectDTO());
catch (NamingException e)
System.out.println(e.toString());
throw new javax.ejb.EJBException(e);
catch (CreateException e)
System.out.println(e.toString());
throw new javax.ejb.EJBException(e);
is that correct and enaugh to insert my row? or is there a better way to do that?
thank u.
regards

Similar Messages

  • Problem in copyItemAtPath when databse create method called in sqlite

    Hi All,
    i m doing one apps based on sqlite 3 and i have created and used database.
    i have developed this program on desktop mac machine with mac os x 10.5.4.
    i test this program on second desktop mac machine it run with perfect
    databse.
    but when i test this program on MacBook with lastes version of mac os x
    10.5.4, program run successfully but database doesn't copy at desire path.
    so my program is not run perfect it crash iphone simulator.
    so ano body has solution for that?
    Thanking you,
    Haresh.

    Please anyone help me

  • Calling a css user created method from jspx page in ADF faces

    Hi all,
    Can anyone help me out to solve an issue calling a css user created method from a jspx page.
    Note: The css method is not the default css method. It needs to be called using 'styleClass' attribute in any tag.
    Thanks
    Neha

    Hi,
    I am not an expert in CSS so I don't know what a css method is. However, CSS can be applied to components via EL accessing a managed bean that returns the sytle text
    Frank

  • Create page definition option on a method call

    I have been developing my first application using ADF with JDeveloper 12c.   After reading all of the documentation, it would appear that I should be able to create a page definition for a method call on a task flow, but when I right-click on my method calls, there is no option to do so.  What am I doing wrong?  Any help would be greatly appreciated.  Maybe I have a setting wrong or something.  Thank you all in advance.

    Hi Frank,
         Thanks for the response.  I did try to right click on the method call, the option to Create Page Definition is absent from the context menu.  That was my source of the problem which prompted me to write the thread.  However, your alternate solution of dropping the operation from the data control panel onto the method call worked like a charm.  It created the page def and bound the method to the call.   Thank you for that one.   I am still curious as to why the option on the context menu is missing for me.

  • Stateless session's one method to call  two bmp's create method

    JSP calls one stateless session's one method and the method calls two bmps'
              create method.
              However, When the second bmp run the create operation, the exception
              happens.
              But the date that the first bmp insert is not rollbacked.
              How can I rollback all data, when the exception happens?
              

    Use JSP actions.
    <jsp:useBean id="shoppingCart" class="com.package.Cart" scope="session">
    <jsp:setProperty name="shoppingCart" property="userName" value="Guest" />
    </jsp:useBean>

  • How can I call the create method in BO from Application Service

    Hello!
    When I create a Business Object, CAF generates some methods automatically.
    How can I call the create method in the BO from Application Service logic?
    When i call the method then the entityManager and the sessionContext is NULL.
    How can I initialize this?
    Can anybody help me?
    Thanks, Thomas

    If you are using CE 7.11...
    1) In the Application Services, add the BO as dependant object in dependencies tab.
    2) In the implemention, add the following codes to call create method of the BO:
    this.get<BO>.createMethod();
    julius

  • Multiple create methods of entity beans in single transcation

    Hi,
    I have some entity beans with CMR. I am managing these entity beans with a Stateful session bean whose transaction type is Container Managed for all its methods.
    In one particular method of this Session bean I am calling two entity bean's create method. i.e I am creating two entity beans through home.create() methods. There are two home.create() methods one after another inside a try catch block.
    I want that the entire operation be under just one transcation so i have also given the transaction attribute as Required for all methods of Session bean and Entity Beans.
    However if i pass invalid parameters to second create method so that it generates exception then still the first create statement is successful and database is updated.
    what i want is that the first create also should be roll backed.
    How can i acheive this through Container Managed Transaction Session Bean?

    Hi Ashwini,
    "Ashwini" <[email protected]> wrote in message news:400291af$[email protected]..
    I have some entity beans with CMR. I am managing these entity beans with a Stateful session bean whose transactiontype is Container Managed for all its methods.
    >
    In one particular method of this Session bean I am calling two entity bean's create method. i.e I am creatingtwo entity beans through home.create() methods. There are two home.create() methods one after another inside a try catch
    block.
    >
    I want that the entire operation be under just one transcation so i have also given the transaction attribute asRequired for all methods of Session bean and Entity Beans.
    >
    However if i pass invalid parameters to second create method so that it generates exception then still the firstcreate statement is successful and database is updated.
    what i want is that the first create also should be roll backed.
    How can i acheive this through Container Managed Transaction Session Bean?o Do you use TXDatasource with your entity beans?
    o In CMT transactions are automatically rolled back only when RuntimeExceptions
    are thrown. What kind of exception is thrown in your case?
    Regards,
    Slava Imeshev

  • Taskflow Method call receiving null parameter.

    Hi all,
    I am using 11.1.1.6. I have created in my application an extra project which is pure Java objects and exposed a master class as a POJO DC. In my application, I have a taskflow where I have dragged and dropped one method from my POJO DC - 2 of the parameters of this methods are coming from an application scope bean. I have debugged the application, and made sure that the object being returned by the getter of my app scope bean is not null. So basically, when the breakpoint is in the return statement of my getter the oject is not null and it has been correctly initialized. Just after that, the next breakpoint is in the class receiving the parameter in my POJO DC class. In there, the object is NULL.
    Does anyone knows wat could be the reason??

    Hi Frank Nimphius-Oracle,
    That is precisely the problem.  The object is being passed as to the taskflow as an input parameter (getting it from my application scope bean). If I access the pageFlowScope inside my taskflow I see it and its there, correctely intialized. However, when I call a method call activity that consumes that object as parameter, all what it gets is null.
    The method that consumes this object is in a separate project, and its exposed in a POJO DC. I don't know if it has to be with the complexity of the object I am passing or what but I don't understand why its not being passed correctly to the DC Method.

  • Closing an anonymous stream in method call

    Will an anonymous stream in a method call be closed in the same manner an anonymous stream that is created in an object instantiation will be?
    I know this will close the anonymous FileInputStream:
    DataInputStream in =
    new DataInputStream(new FileInputStream("filename.txt"));
    /* ... code ... */
    in.close();But will this?
    MyPropertiesClass myPropertiesClass = new MyPropertiesClass();
    myPropertiesClass.store(new FileOutputStream("file.txt"));MyPropertiesClass extends Properties, and uses its store().
    I know the JavaDoc for Properties says:
    "After the entries have been written, the output stream is flushed. The output stream remains open after this method returns."
    My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?
    Thanks for any insight,
    KJ

    My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? > myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?Your only hope would be if FileOutputStream overrode finalize and closed the stream there -- but it doesn't (check the API -- finalize isn't overridden). I doubt if Properties retains a reference to the OutputStream you pass to store -- why would it need to? In any case, the bottom line is that output stream isn't being closed until your process exits.
    Why not bite the bullet and rewrite that line of code so that you can explicitly close the stream?
    OutputStream out = new FileOutputStream("file.txt");
    try {
        myPropertiesClass.store(out);
    } finally {
        out.close();
    }It's not one line, but who cares? You could wrap it up in a short utility method:
    static void storeProperties(Properties properties, String path) {...}

  • Right way to create method?

    Task - The Game class has two elds representing Player one and Player two.
    The constructor for this class has two parameters which are the names of the two players. The
    constructor will initialise the two fields.
    The Game class has a single method called play which has no parameters and does not return
    a value. This method should print out a suitable introduction and then:
    *1. Instruct player one to play first. The instruction should give the name of player one.*
    *2. Invoke the play method of Player one.*
    *3. Announce the score for Player one.*
    *4. Instruct player two to play next. The instuction should give the name of player two.*
    *5. Announce the score for Player Two*
    *6. Print message naming the winning player or annoucing a draw depending on the scores of the two players.*
    private void play()
    printWelcome();
    player1.getName();
    System.out.println("You're player one, its your turn first");
    player1.play();
    player1.getScore();
    player2.getName();
    System.out.println("You're player two, its your turn next");
    player2.getScore();
    }am i headed in the right direction with this?

    import java.util.ArrayList;
    import java.util.Random;
    public class PackOfCards
        private ArrayList<Card> cards;
        private Random rnd;
         * Constructor for objects of class PackOfCards
        public PackOfCards()
            // initialise instance variables
            cards = new ArrayList<Card>();
            rnd = new Random();
            fillPack();
        private void fillPack() {
            for (int i=0; i<52; i++) {
                cards.add(new Card(i));
         * Select a card at random from the pack
         * @return     the card that was selected, or null if the pack is empty
        public Card selectCard()
            if (cards.size() > 0) {
                return cards.remove(rnd.nextInt(cards.size()));
            } else {
                return null;
    * This class models a player.
    public class Player
        private String name;
        private Card[] card = new Card[5];
        private int score = 0;
         * Contructor for objects of class Player.
         * @param A String which initialises the name of the player.
        public Player(String name)
            this.name = name;
         * Gets the score of the player.
         * @return An integer value representing the score of the player.
        public int getScore()
            return score;
         * Gets the name of the player.
         * @return A String representing the name of the player.
        public String getName()
            return name;
         * Gives the player 5 cards from the pack.
        private void fill()
            PackOfCards deck = new PackOfCards();
            int i = 0;
            while(i < card.length) {
                card[i] = deck.selectCard();
                i++;
         * Calls the fill() method and creates the method to enable the player to play the game.
        public void play()
            fill();
            Reader reader = new Reader();
            boolean stillPlaying = true;
            System.out.println(card[0].toString());
            int index = 1;
            while(stillPlaying = true) {
                if(reader.equals("higher") /*&& is correct*/) {
                   if (card[index].getRank() > card[index-1].getRank())
                        score++;
                        index++;
                        System.out.println(card[index].toString());
                if(reader.equals("higher") /*&& is wrong*/) {
                        score = 0;
                        index++;
                        System.out.println(card[index].toString());
                        stillPlaying = false;
                if(reader.equals("lower") /*&& is correct*/) {
                    score++;
                    index++;
                    System.out.println(card[index].toString());
                if(reader.equals("lower") /*&& is wrong*/) {
                    score = 0;
                    index++;
                    System.out.println(card[index].toString());
                    stillPlaying = false;
                if(reader.equals("freeze")) {
                    stillPlaying = false;
            Reader.close();
    }There are a couple of other classes.
    This is the one im having problems with -
    public class Game
        // instance variables - replace the example below with your own
        private Player player1;
        private Player player2;
         * Constructor for objects of class Game
        public Game(Player player1, Player player2)
            // initialise instance variables
            player1 = player1;
            player2 = player2;
        private void play()
            printWelcome();
            player1.getName();
            System.out.println("You're player one, its your turn first");
            player1.play();
            player1.getScore();
            player2.getName();
            System.out.println("You're player two, its your turn next");
            player2.play();
            player2.getScore();
        }

  • How to override the create method invoked by a create form?

    Hello everyone, I'm using ADF Faces and have the next question:
    How can I override the create method which is invoked by a create form to preset an attribute in the new row (the preset value is not fixed, I have to send it to the method as a parameter as it is obtained using an EL expression)?
    In the ADF guide I read how to override a declarative method (Section 17.5.1 How to override a declarative method), but this explains how to do it with a method that is called by a button. I don't know how to do the same with a method which is called automatically when the page is loaded.
    I also tried overriding the view object's createRow() method to receive a parameter with the preset values but it didn't work, I believe that was because the declarative create method is not the same as the view object's createRow. This caused the form to display another row from the viewobject and not the newly created one (I also set the new row into STATUS_INITIALIZED after setting the attribute).
    Well, I hope my problem is clear enough for somebody to help me.
    Thank you!

    Hello,
    I'm not sure you can do it with standard generated Create Form.
    In your view object you'll need to create your own create method with parameters, publish it to client interface and invoke instead of standard generated create action in page definition.
    Rado

  • Error creating service call from wizard

    Hello,
    I am trying to import a static method on a ABAP class using the create service call wizard. It fails in program SAPLWDY_WB_MODEL_WIZARD with an out of bounds error :
    In the running program "SAPLWDY_WB_MODEL_WIZARD", part of a string was about to be accessed with an explicitly specified length.
    However, this length (2) exceeded the current length of the string (1).
    This kind of access is illegal.
    Termination occurred in the ABAP program "SAPLWDY_WB_MODEL_WIZARD" - in "GET_EXTENDED_RELATIVE_NAME".
    The main program was "SAPMSEU0 ".
    >>>>>
    split l_absolute_name at 'TYPE=' into str1 str2.
       if str2(2) = '%_'.           
    <<<<<
    The error occurs when the type is I, and so the string containing the type length is 1.
    I have not had this problem before even though I have imported methods containing the same type in parameters. I understand that nothing has changed on our system.
    Kind regards
    Steve

    hi
    go to service call wizard. Select the radio button "use existent controller. iN the controller field, select componentcontroller
    In the next step select function module>give the bapi name>Now you have table containing node type, name and object type. Under object type column, make all of them of type C ( context node/attribute ) and complete the wizard.
    In your component controller, you will find the nodes as per importing/exporting parameters of BAPi
    Regards
    Vishal Kapoor

  • Error on /SafeMode: error while trying to run project uncaught exception thrown by method called

    i try run VS 2012 with /SafeMode. I create new empty Winform. When I start debug, I got:
    "error while trying to run project uncaught exception thrown by method called through reflection"

    Hi Matanya Zac,
    Did you restart your machine? How about installing the VS2012 update 4?
    >>error while trying to run project uncaught exception thrown by method
    Did you install the VS update in your VS IDE? I met this issue before which was related to the VS update:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/5ead8ee9-ea09-4060-88b0-ee2e2044ff82/error-while-trying-to-run-a-project-uncaught-exception-thrown-by-method-called-through-reflection?forum=vsdebug
    If still no help, I suggest you repair your VS, and then restart your machine, test the result.
    Best Regards,
    Jack
    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.

  • AcquireConnection method call to the connection manager Excel connection Manager failed

    I used VS Studio 2008 (BIDS version 10.50.2500.0) on an WinXp machine (v 5.1.2600 SP3 Build 2600) to create a package that writes multiple query results to different tabbed sheets of a single excel spreadsheet. The package was working just fine and has run
    successfully multiple times, but all of a sudden when opening the project, every single Data Flow task with an Excel Connection Manager displayed error icons. Each raises the following error message when attempting to open the Advanced Editor:
    SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005 Description: "Unspecified error". Error at DataFlow task name: SSIS error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method
    call to the connection manager Excel connection Manager failed with error code 0xC0202009. There may be error messages posted before this with more information on why the Acquire Connection method call failed. Exception from HRESULT: 0Xc020801c (Microsoft.SQlServer.DTSPipelineWrap)
    From the time I created the original package (when it worked fine) until now:
     1) I have been using the same computer, the same login account and the same permissions.
     2) I have been writing to the same (32 bit) 2010 Excel file (which I created) in a folder on my local machine.
     3) The filename and location have not changed; a template file is used each time to move and overwrite the previous file. Both are in the same locations.
     4) I can independently open the target Excel file and the template Excel files with no errors.
     6) The ConnectionString has not changed. The Connnection String I am using is
      Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Conversion\Conversion\Results_dt01.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES;".
     7) Run64BitRuntime is set to False.
    8)  Delay Validation is set to true
    9) This is not running under a SQL job  
    10) There are no child packages being run
    I CAN create a NEW Excel Connection Manager, assigning it the exact same target Excel spreadsheet, successfully, but when I attempt to assign it to the Data Flow destination this error occurs:
    "Test connection failed because of an error in initializing provider. Unspecified error."
    Thinking that the driver might be corrupt, I opened a second SSIS package, which also uses the Excel Connection Manager (same driver) and this package continues to work fine on the same workstation with no errors.
    I have searched online for causes of this error for many hours and found nothing that helps me to solve this issue.
    Does anyone have any suggestions for me?

    Yes, I have verified that the Excel file is not in use or opened by anyone, including me. It has been two months since I opened this particular package, although I have been working with other packages in this project. I just discovered that another
    package in the same project has the same problem - all Data Flows that output to an Excel Destination now have the same error icons. This second packages outputs to an entirely different Excel file than in the first package.  A summay:
    Package #1 has error on every Excel Destination and uses templateA to overwrite fileA and then writes to fileA
    Package #2 has error on every Excel Desintation and uses templateB to overwrite fileB and then writes to fileB
    Package #3 has no error on any Excel Destination and is linked to multiple files (none are A or B)
    Package #1 and #2 are in the same project, but Package #3 is in a separate project .
    I will try replacing the Excel files with new ones for Package 1 and 2.

  • Issue with a method call in a TaskFlow (works 2 times instead of 1)

    Hi guys,
    i'm using jdev11.1.1.1.2.0 and the integrated weblo or remote weblo 10.3.2.0.
    I'm encountering a problem with a method call which is invoked inside a Task Flow.
    Let me tell us the details of :
    I'm invoking a method call which is part of a Task Flow from the backingbean of the view which is placed before the method call in the taskFlow diagram.
    AN outcome String from the method of the backing bean allows to navigate to the method of the Task flow.
    The method call is called and works normally BUT MY PROBLEM IS THAT THE METHOD IS CALLED TWO TIMES SO THE RESULT IS FALSE.
    For information, the second time the method is called it takes care of the result when it is invoked the first time. So its parameters are updated and are a little different from the first time to the second time.
    NB : This method consists of inserting a row in the database. My result is 2 rows inserted instead of one.
    Thanks for help for this strange behaviour

    Hi
    create a temp calculated column
    =IF(ISBLANK([Duration]),"",[Item Start Date]+([Duration])
    and check if it's working OK
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

Maybe you are looking for

  • Need a Exit or BADI  For Changing Validation Class  (PRUEFKL) during  EL28

    need to change the Validation Class Validation Class  (PRUEFKL)  or send it blank in order to remove all valdition during Meter read uplaod  , Can any one suggest a BADI or user exit or anything where in i can change the Validtion class before valida

  • HOW DO YOU CHANGE THE REGION FROM GMT TO EASTERN STANDARD TIME

    i have been having a problem for one month with Photosmart 7510 all in one. I can't use the efax feature.  Get an error message unable to sync.  I have called hp and spoke to supervisor and also called efax.com.  They are not supporting this feature

  • Help with AM tutorial

    Hello, I've been trying to accomplish exercises in this http://developers.sun.com/identity/reference/techart/secure-ws2.html tutorial, but I'm stuck at exercise 3. No matter what I do, I get runtime error (see below). Also, my screens (regarding wscW

  • Itunes crashes when connecting iphone

    Hi all, I have an iPhone 5 running ios 7.0.2 and iTunes lastest version installed on Windows 8. The problem is, every time I try to connect my iPhone to my computer, iTunes crashes. This started occuring recently (since I upgraded iTunes to the lates

  • REST Services - Permission exceptions being thrown

    In setting up a mobile site which will make use of REST services we have started to see exceptions in the log file. These exceptions do not happen all the time - that is they are random in nature. We may see them for about an hour or so and then not