Workshop Database Controls

We are using workshop as our development tool for a new project. Are there any guidelines concerning when to use a Database Control vs an EJB for database updates? How do Database Controls differ from entity EJB's in terms of transaction management?

Henrik--
In general, the Workshop Database Control executes the SQL that you
see in each method's annotations. So, you can do a batch update in the
context of a single transaction if you wrap a database control in a
custom control which calls database control methods many times.
Relative to your JPF, this would look like a batch update.
If you pass RowSet objects to Database Control methods, the RowSet
will generate update / insert / delete SQL statements to push changes
made in the RowSet into the database.
Hope that helps...
Eddie
Henrik Fredholm wrote:
I want to insert many rows into a database. Does the Workshop Database Control
or RowSet Control support batch update? How is it done?

Similar Messages

  • Workshop 81 Database Controls & Informix

    Hi !
    Does anybody have a solution for the following problem ?
    Problem: Using Workshop 81 and Informix JDBC driver from IBM (version 2.21), I'm
    trying to build a database control to insert/retrieve large TEXT data into Informix
    DB.
    Q: Of which java data type should be the input/return value from my method in
    the Workshop database control (I think it should be java.sql.Clob) Is this correct?
    Q: If so, does IBM's Informix JDBC driver support operations like (rs.getClob,
    etx on TEXT fileds) ?
    Q: If not, can I build this kind of database control with IBM's JDBC driver at
    all ?
    Please forward possible solutions to my email ([email protected]).
    Mux thnx,
    Matevz

    Since no one answered yet, I'll answer myself (some). I found a neat article and the code to go with it on dev2dev that handles paging through many rows by wrapping the <netui:repeater> tag. See:
    http://dev2dev.bea.com/pub/a/2005/02/netui_repeater.html
    Very cool. Thanks to the author, Gerald Nunn. I'd much rather find code already written than have to write it myself. ;-)

  • How to use database control to execute sql queries which change at run time

    Hi all,
    I need to execute sql queries using database controls , where the sql changes
    at run time
    based on some condition. For eg. based on the condition , I can add some where
    condition.
    Eg. sql = select id,name from emp where id = ?.
    based on some condition , I can add the following condition .
    and location = ?.
    Have anybody had this kind of situation.
    thanks,
    sathish

    From the perspective of the database control, you've got two options:
    1) use the sql: keyword to do parameter substitution. Your observation
    about {foo} style sbustitution is correct -- this is like using a
    PreparedStatement. To do substitution into the rest of the SQL
    statement, you can use the {sql: foo} substitution syntax which was
    undocumented in GA but is documented in SP2. Then, you can build up
    the filter clause String yourself in a JPF / JWS / etc and pass it into
    the DB control.
    For example:
    * @jc:sql statement="select * from product {sql: filter}"
    public Product[] getProducts(String filter) throws SQLException;
    This will substitute the String filter directly into the statement that
    is executed. The filter string could be null, "", "WHERE ID=12345", etc.
    2) you can use the DatabaseFilter object to build up a set of custom
    sorts and filters and pass that object into the DB control method.
    There have been other posts here about doing this, look for the subject
    "DatabaseFilter example".
    Hope that helps...
    Eddie
    Dan Hayes wrote:
    "Sathish Venkatesan" <[email protected]> wrote:
    Hi Maruthi,
    The parameter substituion , I guess is used like setting the values for
    prepared
    statements.
    What I'm trying to do , is change the sql at run time based on some condition.
    For example ,
    consider the following query :
    select col1,col2 from table t where t.col3 > 1
    At run time , based on some condition , I need to add one more and condition.
    i.e. select col1,col2 from table t where t.col3 > 1 and t.col4 < 10.
    This MAY not address your issue but if you are trying to add "optional" parameters
    you may try including ALL the possible parameters in the SQL but send in null
    for those params that you don't want to filter on in any particular case. Then,
    if you word your query
    as follows:
    select col1, col2 from table t where t.col3 > 1 and (t.col4 = {col4param} or
    {col4param} is null) and (t.col5 = {col5param} or {col5param} is null) ...
    you will get "dynamic" filters. In other words, col4 and col5 will only be
    filtered if you send in non-null parameters for those arguments.
    I have not tried this in a WL Workshop database control but I've used
    this strategy dozens of times in stored procedures or jdbc prepared statements.
    Good luck,
    Dan

  • IS java database control (jcx) sinchronized?

    Hi,
    I use workshop for create a web application.
    I have make a java control database and I have import this control in my page flow.
    So the database control result in controller class as a class intance variable .This class variable is used for all client request, there are synchronization problem?
    In servlet analog case certainly , a class variable would have to be syncrhonized, and here ?
    Thanks !

    Workshop Database control makes synchronous call to shuffle data to and from data source. Is this the question? Or, do you mean thread-safety?

  • Workshop 8.1 beta - problem with creating Database control

    I am using Workshop 8.1 beta to create a webservice, which uses a database control
    to query the Db, as simpel as it comes. However, I get the following exception
    when I try to create the new DBControl:
    java.lang.AssertionError
         at workshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTables(DbControlWizardUtil.java:268)
         at workshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTablesAndViews(DbControlWizardUtil.java:223)
         at workshop.pageflow.ui.dialogs.wizards.jbcx.db.step.PickMethodsStep$4.run(PickMethodsStep.java:299)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
         at java.awt.Dialog.show(Dialog.java:538)
         at com.bea.ide.ui.wizard.WizardDialog.show(WizardDialog.java:117)
         at workshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizard.runWizard(DbControlWizard.java:96)
         at workshop.pageflow.ui.dialogs.wizards.jbcx.db.FileNewDbControlWizardAction.doAction(FileNewDbControlWizardAction.java:58)
         at workshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.launchWizard(DbControlWizardDocHandler.java:87)
         at workshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.createNewFile(DbControlWizardDocHandler.java:72)
         at workshop.shell.wizards.NewFileWizard.getDisplayURI(NewFileWizard.java:232)
         at workshop.shell.actions.file.FileNewAction$1.run(FileNewAction.java:111)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    What's interesting is that it works well for the default dbcontrols of cgDataSource
    and cgSampleDataSource. The connection pool and the datasources were created successfully
    in the server. Its the workshop that seems to be complaining.
    Anyone face this problem?

    Sanjeev,
    This newsgroup is for Workshop 7.0 issues, till WebLogic Platform 8.1 goes
    GA.
    Meanwhile, please post Workshop 8.1 beta issues on
    weblogic.developer.interest.81beta.workshop newsgroup.
    Regards,
    Anurag
    "Sanjeev Saha" <[email protected]> wrote in message
    news:[email protected]...
    >
    I am using Workshop 8.1 beta to create a webservice, which uses a databasecontrol
    to query the Db, as simpel as it comes. However, I get the followingexception
    when I try to create the new DBControl:
    java.lang.AssertionError
    atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTab
    les(DbControlWizardUtil.java:268)
    atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.util.DbControlWizardUtil.getTab
    lesAndViews(DbControlWizardUtil.java:223)
    atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.step.PickMethodsStep$4.run(Pick
    MethodsStep.java:299)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
    atjava.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
    va:197)
    atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
    :150)
    atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
    :140)
    at java.awt.Dialog.show(Dialog.java:538)
    at com.bea.ide.ui.wizard.WizardDialog.show(WizardDialog.java:117)
    atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizard.runWizard(DbCon
    trolWizard.java:96)
    atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.FileNewDbControlWizardAction.do
    Action(FileNewDbControlWizardAction.java:58)
    atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.launc
    hWizard(DbControlWizardDocHandler.java:87)
    atworkshop.pageflow.ui.dialogs.wizards.jbcx.db.DbControlWizardDocHandler.creat
    eNewFile(DbControlWizardDocHandler.java:72)
    atworkshop.shell.wizards.NewFileWizard.getDisplayURI(NewFileWizard.java:232)
    at workshop.shell.actions.file.FileNewAction$1.run(FileNewAction.java:111)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
    atjava.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
    va:197)
    atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
    :150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    What's interesting is that it works well for the default dbcontrols ofcgDataSource
    and cgSampleDataSource. The connection pool and the datasources werecreated successfully
    in the server. Its the workshop that seems to be complaining.
    Anyone face this problem?

  • Database control hangs in Workshop Tutorial !!!

    Hi,
    I am using WLS 7.0.1.0/SP1 ( latest version ) with Workshop included, on Windows
    XP Prof. In Workshop Tutorial, Step 3, the test hangs at the execution of
    Applicant dbApplicant = bankruptciesDB.checkForBankruptcies(taxID);
    I am asking if it is a known problem? There may be several reasons for this and
    it is too expensive to investigate all of them:
    1. Tutorial text misses a fragment describing special configuration for the Database
    control
    2. Tutorial is correct but default ( installation ) configuration of Database
    control has bug(s)
    3. A helper class, implementing BankruptciesDatabaseControl interface, is missed.
    4. Implementation of Database control is buggy. What the magic happens when I
    “SELECT TAXID, FIRSTNAME, LASTNAME, CURRENTLYBANKRUPT FROM BANKRUPTCIES WHERE
    TAXID={taxID}”, i.e. only a sub-set of “Applicant” attributes in the query, and
    how Database control ( using my interface method public Investigate.Applicant
    checkForBankruptcies(String taxID) ) knows which database table field to map to
    which Applicant” attribute ? [I suppose, creation of “Applicant” class is independent
    from the database schema, isn’t it ?]
    Thank you,
    - Michael

    Sure, I will send you the dump. Please, provide me with your e-mail.
    As of column names, don’t you find it error-prone approach where a developer has
    to “find” the names and type them into the code ? Since you are already deal with
    a db adapter/controller, I suggest, the adapter has to read a db schema, gets
    the column names and data types. In other words, I would expect in this case the
    same functionality as provided by, e.g., TogetherSoft’s Control Center. It creates
    Entity Beans out of the db schema and only then allows you to manipulate them.
    Thank you and wait for your e-mail.
    - Michael
    "Anurag Pareek" <[email protected]> wrote:
    Michael,
    The names of the elements in the 'Applicant' class should match one-on-one
    with the database column names in the corresponding table.
    I guess you are using the default Pointbase database. Can you check whether
    you were able to create successful connections to the Pointbase database
    during server startup?
    If the server is hanging at the statement you have mentioned, can you
    take a
    thread dump by using Ctrl->Break and email it to me.
    Thanks,
    Anurag
    "Michael Poulin" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I am using WLS 7.0.1.0/SP1 ( latest version ) with Workshop included,on
    Windows
    XP Prof. In Workshop Tutorial, Step 3, the test hangs at the executionof
    Applicant dbApplicant = bankruptciesDB.checkForBankruptcies(taxID);
    I am asking if it is a known problem? There may be several reasonsfor
    this and
    it is too expensive to investigate all of them:
    1. Tutorial text misses a fragment describing special configurationfor
    the Database
    control
    2. Tutorial is correct but default ( installation ) configuration ofDatabase
    control has bug(s)
    3. A helper class, implementing BankruptciesDatabaseControl interface,is
    missed.
    4. Implementation of Database control is buggy. What the magic happenswhen I
    "SELECT TAXID, FIRSTNAME, LASTNAME, CURRENTLYBANKRUPT FROM BANKRUPTCIESWHERE
    TAXID={taxID}", i.e. only a sub-set of "Applicant" attributes in thequery, and
    how Database control ( using my interface method publicInvestigate.Applicant
    checkForBankruptcies(String taxID) ) knows which database table fieldto
    map to
    which Applicant" attribute ? [I suppose, creation of "Applicant" class
    is>independent>> from the database schema, isn't it ?
    Thank you,
    - Michael

  • Using "in" clause in the query in Database control

    Hi,
    I have a database control and need to fire an update query to update a set of rows based on a list of values as input
    Like below
    update tablename
    set column1="value1"
    where column2 in (.......)
    I need to pass a list of values for this query where column2 is a NUMBER field in Oracle DB.
    can anyone help me how to go about passing this list of values?
    Help is appreciated.
    Thanks

    You may build the comma-separated list in Java and use " {sql: ...} " in your query: http://e-docs.bea.com/workshop/docs81/doc/en/workshop/java-class/com/bea/control/DatabaseControl.html (sorry, I can't find the documentation for WLI 9.2).

  • Database control support for "IN" clause

    Does anyone know if the database control supports an 'IN' clause construct, e.g.,
    SELECT name FROM mytable WHERE id IN ( {values} )
    where values would be passed in as a variable length array of Strings or Integers?
    Thanks,
    DC

    I forgot to paste in the link to the documenation. Here it is
    http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conParameterSubstitutionInJwsSqlStatements.html
    "John Rohrlich" <[email protected]> wrote in message
    news:[email protected]..
    Dave,
    I think you will need to build the sql and pass it to the control method.
    For example
    String matchMe = "('Bill Walton', 'Fred Williams')";
    Customer[] customers = weblogicCustomer.getCustomersIn(matchMe);
    * @jc:sql statement= "SELECT name from weblogic.customer where namein
    {sql: matchMe}"
    public Customer[] getCustomersIn(String matchMe);
    Here is a link to a doc explaining parameter substitution for jc:sql
    statements
    - john
    "Dave Chappelle" <[email protected]> wrote in message
    news:[email protected]..
    Does anyone know if the database control supports an 'IN' clauseconstruct, e.g.,
    SELECT name FROM mytable WHERE id IN ( {values} )
    where values would be passed in as a variable length array of Strings orIntegers?
    Thanks,
    DC

  • Using Database Control in JPDs - Best Practice

    Hi,
    I would like to know the best way of using DB control in a JPD
    like.. which one is better.
    a) Using a Control Send node in workshop and configuring it from the workshop design view as a separate node.
    or
    b) In a perform node call the method on the DB control object.
    like..
    * @common:control
    private com.abc.def.SampleDBCtrl xxxx;
                        xxxx.insertIntoDb(parameter1, parameter2);
    Is there any disadvantages on approach b over approach a or any issues performance-wise.
    I would like to know which is one is better.
    I sincerely appreciate ur advice on this.
    Thanks

    Hello,
    I do not know the source of your problem, but
    a.) Check if the db colum types match the parameter types
    See http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conMappingDBFieldsToJavaTypesInTheDBCtrl.html for more info
    b.) command-type is only used for rowset controls.
    -Kai

  • Problem in using database control in JPD.

    Hi All,
    I am developing a JPD which also involves using DB control. The connected DB is Oracle 9.2.
    I have created DB control with "insert" method and one with "update" method.
    When i call "insert" method in JPD by dynamically passing values, it works fine. I have a "task control" in a JPD and once the task is complted by a specific user, again I am calling "update" method.
    Here it fails to update the DB. The strange part is that the perform node executes after the control send node and there are no exceptions. Heres my update method
    * @jc:sql command-type="update" statement::
    * UPDATE PROPOSAL_INFO SET status = {status} WHERE track_num = {trackingNumber}
    * @common:message-buffer enable="false"
    void updateStatusAndDesc(String status,String trackingNumber);
    The strange part is that, If I hard code the "status" and "trackingNumber" value instead of passing dynalically by using (ie without using {}), then update happens.
    Can somebody suggest me the solution for this problem??
    Thanks in advance,
    Prashanth Bhat.

    Hello,
    I do not know the source of your problem, but
    a.) Check if the db colum types match the parameter types
    See http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conMappingDBFieldsToJavaTypesInTheDBCtrl.html for more info
    b.) command-type is only used for rowset controls.
    -Kai

  • Woes wiring up an ejb to use a database control

    first my question & then background:
    how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
    here's the scene:
    i created a java page flow from a database control & this works correctly, but i also need to be able to expose some of the functionality to another deployed application. this application, incidentally is not a workshop application; but rather is a hand-coded war.
    the first application (a workshop app) renders forms that use a database control to persist the data. it only uses one table & therefore, there is only one pojo. as i mentioned, this resides in web project & works correctly. i abstracted my dbcontrol & my pojo to a separate java controls project & built this as a library. the jpf still has no problems seeing the dbcontrol.
    there is a second application (a non workshop app) that needs to be able to use a method provided by the dbcontrol. i created an ejb in a third project in the first application that makes the call to dbcontrol in the exact same way that the jpf did. but i am finding, however, that the dbcontrol is null whenever the ejb makes the call to it's method.
    here's the more detailed design:
    i started with a database control. i mapped to my datasource, wrote out the sql for the methods i wanted & generated the pageflow from this. i rewrote the pageflow/jsps to suit my needs & everything just works. i did notice at the time that i generated the page flow that the dbcontrol was never instantiated. here is a snippet of the jpf:
    <pre>
    public class SiteAlertMessageManagementController extends PageFlowController {
    * This is the control used to generate this pageflow
    * @common:control
    private SiteAlertMessageDBControl dbControl;
    public Forward getCurrentMessage() {  
    SiteAlertMessage currentMessage = dbControl.getCurrentMessage();
    </pre>
    because SiteAlertMessageDBControl is an interface, i assumed that the '@common:control' annotation told weblogic what it needed to know in order to instantiate a runtime class of time SiteAlertMessageDBControl. because it just worked, i never questioned this.
    with the form read/write functionality complete, i assumed i could quickly wrap an ejb around the dbcontrol method & be done with it. i soon realized that i could not create an ejb inside a web project & that an ejb project would not have classpath visibility to my dbcontrol & pojo, so i put the dbcontrol & the pojo into a java control project & made a library out of this. i double checked that the web project could see the classes in the library & they could.
    so i created a separate ejb project that also could now see the classes in the library. i thought i was in the home stretch. i now have these projects in my first application:
    administrationControls, administrationWeb, & administrationEjb. i moved the administrationControls.jar & the administrationEjb.jar over to the WEB-INF/lib directory of my (remember: non-workshop) war & wired up the code to pull the bean off jndi tree to make the rmi call. but it didn't work. so i backtracked & created a new jsp back in my workshop project that would make the same rmi call so that i could use the debugger. with this as the background, here is my specific problem.
    what i noticed is that the ejb code itself works correctly. i guess i should show it as well.
    <pre>
    public class SiteAlertMessagesAPI extends GenericSessionBean implements SessionBean {
    * This is the control used to generate this pageflow
    * @common:control
    private SiteAlertMessageDBControl dbControl;
    public void ejbCreate() {
    // Your code here
    * @ejbgen:remote-method
    public SiteAlertMessage getCurrentMessage() throws Exception {
    SiteAlertMessage message = null;
    try {
    // dbControl is null here
    message = dbControl.getCurrentMessage();
    catch (Exception e) {
    e.printStackTrace();
    return message;
    </pre>
    the problem is that my dbControl object is null. what i did was cut & paste the code from the jpf over to my bean. like i stated earlier, i assumed that the annotation would tell weblogic to instantiate an instance. this was obviously not the case. incidentally, i rewrote my ejbCreate() method like this:
    <pre>
    public void ejbCreate() {
    // Your code here
    dbControl = new SiteAlertMessageDBControl();
    </pre>
    but workshop gives me a "error: this type is abstract and thus cannot be instantiated" warning.
    my question is: how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
    any light you could shed on this would be most appreciated. thanks,
    doug

    Hi,
    unfortunatly, it's not possible to use a control outside a control or a
    web service...
    Emmanuel
    douglas thomas a ?crit :
    first my question & then background:
    how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
    here's the scene:
    i created a java page flow from a database control & this works correctly, but i also need to be able to expose some of the functionality to another deployed application. this application, incidentally is not a workshop application; but rather is a hand-coded war.
    the first application (a workshop app) renders forms that use a database control to persist the data. it only uses one table & therefore, there is only one pojo. as i mentioned, this resides in web project & works correctly. i abstracted my dbcontrol & my pojo to a separate java controls project & built this as a library. the jpf still has no problems seeing the dbcontrol.
    there is a second application (a non workshop app) that needs to be able to use a method provided by the dbcontrol. i created an ejb in a third project in the first application that makes the call to dbcontrol in the exact same way that the jpf did. but i am finding, however, that the dbcontrol is null whenever the ejb makes the call to it's method.
    here's the more detailed design:
    i started with a database control. i mapped to my datasource, wrote out the sql for the methods i wanted & generated the pageflow from this. i rewrote the pageflow/jsps to suit my needs & everything just works. i did notice at the time that i generated the page flow that the dbcontrol was never instantiated. here is a snippet of the jpf:
    <pre>
    public class SiteAlertMessageManagementController extends PageFlowController {
    * This is the control used to generate this pageflow
    * @common:control
    private SiteAlertMessageDBControl dbControl;
    public Forward getCurrentMessage() {  
    SiteAlertMessage currentMessage = dbControl.getCurrentMessage();
    </pre>
    because SiteAlertMessageDBControl is an interface, i assumed that the '@common:control' annotation told weblogic what it needed to know in order to instantiate a runtime class of time SiteAlertMessageDBControl. because it just worked, i never questioned this.
    with the form read/write functionality complete, i assumed i could quickly wrap an ejb around the dbcontrol method & be done with it. i soon realized that i could not create an ejb inside a web project & that an ejb project would not have classpath visibility to my dbcontrol & pojo, so i put the dbcontrol & the pojo into a java control project & made a library out of this. i double checked that the web project could see the classes in the library & they could.
    so i created a separate ejb project that also could now see the classes in the library. i thought i was in the home stretch. i now have these projects in my first application:
    administrationControls, administrationWeb, & administrationEjb. i moved the administrationControls.jar & the administrationEjb.jar over to the WEB-INF/lib directory of my (remember: non-workshop) war & wired up the code to pull the bean off jndi tree to make the rmi call. but it didn't work. so i backtracked & created a new jsp back in my workshop project that would make the same rmi call so that i could use the debugger. with this as the background, here is my specific problem.
    what i noticed is that the ejb code itself works correctly. i guess i should show it as well.
    <pre>
    public class SiteAlertMessagesAPI extends GenericSessionBean implements SessionBean {
    * This is the control used to generate this pageflow
    * @common:control
    private SiteAlertMessageDBControl dbControl;
    public void ejbCreate() {
    // Your code here
    * @ejbgen:remote-method
    public SiteAlertMessage getCurrentMessage() throws Exception {
    SiteAlertMessage message = null;
    try {
    // dbControl is null here
    message = dbControl.getCurrentMessage();
    catch (Exception e) {
    e.printStackTrace();
    return message;
    </pre>
    the problem is that my dbControl object is null. what i did was cut & paste the code from the jpf over to my bean. like i stated earlier, i assumed that the annotation would tell weblogic to instantiate an instance. this was obviously not the case. incidentally, i rewrote my ejbCreate() method like this:
    <pre>
    public void ejbCreate() {
    // Your code here
    dbControl = new SiteAlertMessageDBControl();
    </pre>
    but workshop gives me a "error: this type is abstract and thus cannot be instantiated" warning.
    my question is: how do i wire up an ejb to use a database control jcx object so that the dbcontrol is instantiated at runtime?
    any light you could shed on this would be most appreciated. thanks,
    doug

  • Database Control error

    Hi,
    I'm using Weblogic Workshop 7.0.1.0.0829.0, developing a small service to retrive data from SQL server 2000. I created SQL connection pool to SQL server and TxDataSource using this pool. I could able to see the datasources from database control wizard in workshop. I'm using conversation for the webservices. whenever I execute the webservice, I get the following error :
    weblogic.jws.control.ControlException: Unable to obtain connection to database[Connection has already been created in this tx context for pool named cgPool. Illegal attempt to create connection from another pool: sqlPool] at weblogic.knex.control.DatabaseControlImpl.acquireResources(DatabaseControlImpl.java:261) at weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext.java:220) at weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at WebServCntrlControl.LoadUser(WebServCntrlControl.ctrl) at Login.Verify(Login.jws:48)
    How to resolve it?

    Muthu,
    The exception that you are seeing is due of the fact that you are using two
    different TX datasources within the same transaction context.
    Workshop needs the following
    1. an XA connection pool and data source for the conversational state
    2. another XA connection pool and data source for the DB control which is
    used in the conversational method,
    3. a non-XA connection pool to which the JMSJDBCStore connects.
    Reconfiguring your application and the workshop runtime to use a single non
    transactional datasource-cgDataSource, removes the need for TX Data Sources
    and XA Drivers.
    The other option is to
    Upgrade to Service Pack 2 and reconfigure the connection pools to use the XA
    driver.
    Hope this helps.
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Muthu" <[email protected]> wrote in message
    news:3efbc1d1$[email protected]..
    Hi,
    I'm using Weblogic Workshop 7.0.1.0.0829.0, developing a small serviceto retrive data from SQL server 2000. I created SQL connection pool to SQL
    server and TxDataSource using this pool. I could able to see the datasources
    from database control wizard in workshop. I'm using conversation for the
    webservices. whenever I execute the webservice, I get the following error :
    >
    weblogic.jws.control.ControlException: Unable to obtain connection todatabase[Connection has already been created in this tx context for pool
    named cgPool. Illegal attempt to create connection from another pool:
    sqlPool] at
    weblogic.knex.control.DatabaseControlImpl.acquireResources(DatabaseControlIm
    pl.java:261) at
    weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
    .java:220) at
    weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
    WebServCntrlControl.LoadUser(WebServCntrlControl.ctrl) at
    Login.Verify(Login.jws:48)
    >
    How to resolve it?

  • Problem with database control returning multiple rows as Array  using Oracle

    Has anybody using Oracle gotten a Database control that
    returns multiple rows to work returning an array?
    The only way I can seem to return multiple rows is by returning
    a RowSet. Returning an array gives me a NullPointerException
    (when called within a pageFlow). When calling a database control
    that returns an array from a web service I get a
    "java.sql.SQLException: ResultSet has no more data." error.
    The samples using the pointbase database seem to work, but when I
    converted the CustomerDBClient web service to use Oracle, it starts
    failing on calling the database control that returns an array
    with: "java.sql.SQLException: ResultSet has no more data."
    Has anybody gotten this to work using Oracle?
    I'm also having some problem returning an Iterator. It seems
    to work when called from a web service, but returns nothing
    if called from a page flow.
    I'm using Oracle 8.1.7 and WebLogic 8.1.
    Eric

    Do you need a particular service pack installed to return an array of custom object?
    I am getting a ResultSet contained no data error when trying.
    Thanks,
    -Thomas
    "Robin Karlin" <[email protected]> wrote:
    >
    Eddie O'Neil <[email protected]> wrote:
    All--
    Unfortunately, returning an Iterator to a JPF (or JSP) from a
    database control is broken in WLW 8.1, though it will work inside of
    a
    JWS or JCS.
    There shouldn't be a problem with returning an array of objects out
    of Oracle to the JPF, and if you need an Iterator specifically, youcan
    wrap the array in an Iterator implementation.
    Sorry for the inconvenience.
    Eddie
    Lenny wrote:
    I have gotten it to work on Oracle using Array:)
    However, I haven't gotten it to work on Oracle using Iterator:( Itis so
    simple, but doesn't work:(
    "Eric Dokken" <[email protected]> wrote in message
    news:[email protected]...
    Has anybody using Oracle gotten a Database control that
    returns multiple rows to work returning an array?
    The only way I can seem to return multiple rows is by returning
    a RowSet. Returning an array gives me a NullPointerException
    (when called within a pageFlow). When calling a database control
    that returns an array from a web service I get a
    "java.sql.SQLException: ResultSet has no more data." error.
    The samples using the pointbase database seem to work, but when I
    converted the CustomerDBClient web service to use Oracle, it starts
    failing on calling the database control that returns an array
    with: "java.sql.SQLException: ResultSet has no more data."
    Has anybody gotten this to work using Oracle?
    I'm also having some problem returning an Iterator. It seems
    to work when called from a web service, but returns nothing
    if called from a page flow.
    I'm using Oracle 8.1.7 and WebLogic 8.1.
    Eric
    I get the same error that Eric reported when trying to return an Array
    of objects.
    It is really frustrating because I can't use much of the built-in control
    logic
    that WLW provides. All I did was create a data pool for Oracle and a
    datasource.
    I modified the sample app in C:\bea81\weblogic81\samples\workshop\SamplesApp\WebApp\callJavaControl
    to point to that datasource and I get the error that Eric reports above.
    Can
    anyone help me out????
    Thanks,
    Robin

  • Database controls returning large datasets

    In reading the Workshop help (Working with Java Controls -> Using Built-In Controls -> Database Control -> Designing a Database Control) it says one technique you should use is to return an Iterator:
    "The Iterator wraps a java.sql.ResultSet object that accesses the database efficiently. The Iterator and ResultSet objects transparently make occasional requests to the database to obtain more data as needed as you iterate through the resultset. Using this technique, you may enable processing of resultsets that are larger than the available memory."
    "However, note that ResultSets and Iterator types cannot be returned directly to classes in the web-tier (web services and page flows reside in the web-tier). This is because ResultsSet and Iterators will always be closed by the time they reach the web tier. As a workaround for this limitation, you should return custom array types to the web tier (such as Customer[])."
    OK. So, what do I do? Have the DB control return an iterator, but have a custom control in front of it for the page flow that calls it and returns a Customer array? Does the custom control have to "manage" the iteration (i.e. return an array of 10 customers, when you ask for more iterate over the next 10 and return it, etc.)?
    Thanks.

    Since no one answered yet, I'll answer myself (some). I found a neat article and the code to go with it on dev2dev that handles paging through many rows by wrapping the <netui:repeater> tag. See:
    http://dev2dev.bea.com/pub/a/2005/02/netui_repeater.html
    Very cool. Thanks to the author, Gerald Nunn. I'd much rather find code already written than have to write it myself. ;-)

  • EnityBean or Database Control

    Hi, there
    I would like to gather some options about in which case that we should use
    database control in workshop to do DB access and in which case we should use
    EntityBean. It seems that database control is called within a transaction
    context --- if a custom control mades multiple calls to the database
    control, all calls are within one single transaction (right?). So what is
    the guideline we should have to choose one instead of the other?
    Thanks
    Coco

    "coco" <[email protected]> wrote in message
    news:[email protected]..
    I would like to gather some options about in which case that we should use
    database control in workshop to do DB access and in which case we shoulduse
    EntityBean. It seems that database control is called within a transaction
    context --- if a custom control mades multiple calls to the database
    control, all calls are within one single transaction (right?). So what is
    the guideline we should have to choose one instead of the other?Generally speaking database controls are a good solution on a smaller
    project as they enable you to put together a solution pretty quickly. They
    do however have fairly limited features though, for example no automatic
    management of keys or relationships between objects. On larger projects I
    would recommend using a more full featured object persistence layer such as
    entity beans or hibernate.
    Gerald

Maybe you are looking for

  • How to make a http request from a pl/sql procedure(URGENT)

    I need to make a http request from a pl/sql procedure, can any one tell me which built-in package and which procedure/function we serve my need? Thanks in advance. Ram Prasad.

  • Getting the error in the sap script

    Hi, I am running the Tcode f.26, which uses the standard sap script named F_DUZI_01. When running I am getting the error: Element 0031 window INFO is not defined for F_DUZI_01 Please suggest what should i do or what could be the reason behind the pro

  • Can iTunes play 5.1 audio on a Mac (not AppleTV)?

    My Macbook, like many other Macs, has a digital audio port that doubles as a stereo mini-jack for headphones. I'm interested in importing videos into iTunes with 5.1 sound and playing them with iTunes, with the audio going out the mini-jack to a tosl

  • Brief of all in built function

    Hi All Is there any reference page where I can find a concise description of all inbuilt functions in SQL an PL/SQL available over ORACLE. Would appreciate if some one can send me a link to that page. Thanks in advance Vikas Chandra

  • How iget 100 dpi resolution image from hp 1005mep

    How I get 100 dpi resolution image from hp1005mep  When I scan a document I always get 96dpi image