No way to use CMP in OC4J?

Hi, it seems we can never user CMP in OC4J.
OC4J does not support EJB-QL. So how can we implement the finder methods?
1) One way is to put finder methods in ejb home interface, and add implementation (using direct JDBC) in bean class. But the server could not find the correnspondent finder methods even we match them; Also, if we use findBy*** in home interface, and use ejbFindBy***, it still does not work.
2) Another option is to put finder method as an odinary business method in remote interface, and add implementation (using direct JDBC) in bean class. But, before we call this method, we must instantiate the bean by calling create() (without arguments, because we do not want to create record to db). We will get an error: Primary key was null.
So it seems we can never use CMP in OC4J, until it supports EJB-QL.
Thanks,

I use CMP all the time. OC4J (since it is based on Orion) should generate certain finder queries (except for perhaps the WHERE clause that you may have to add yourself to the orion-ejb-jar.xml file) for you just by entering them in the home interface. You can do advanced finders as well. What you need is the proper documentation:
Checkout:
http://kb.atlassian.com/content/orionsupport/articles/finders.html
http://kb.atlassian.com/content/orionsupport/articles/ejbfinderquery.html
as good places to start. No JDBC necessary!
Cheers
Ray
Hi, it seems we can never user CMP in OC4J.
OC4J does not support EJB-QL. So how can we implement the finder methods?
1) One way is to put finder methods in ejb home interface, and add implementation (using direct JDBC) in bean class. But the server could not find the correnspondent finder methods even we match them; Also, if we use findBy*** in home interface, and use ejbFindBy***, it still does not work.
2) Another option is to put finder method as an odinary business method in remote interface, and add implementation (using direct JDBC) in bean class. But, before we call this method, we must instantiate the bean by calling create() (without arguments, because we do not want to create record to db). We will get an error: Primary key was null.
So it seems we can never use CMP in OC4J, until it supports EJB-QL.
Thanks,

Similar Messages

  • How to use the same OC4j server with different port number

    How to use the same OC4j server with different port numbers..?
    I have to OC4J installed on my machine on different hard disk drives....
    I want to be able to run both the server simultaneously..?
    is it possible ..it yes then how..?
    for that i have changed the port number of one server...
    but when i am trying to start the other server with different port number..it says that JVM -Bind already...
    Is there any clues...?
    Nilesh G

    In the config directory:
    default-web-site.xml: Change the port the HTTP listener listens on
    jms.xml: Change the port the JMS service listens on
    rmi.xml: Change the port the ORMI listener listens on.
    Or, you can add another web-site.xml file, and deploy your applications to 1 server, and bind the web applications to the different web sites. This way you only have to deploy your applications to 1 place.
    Rob
    Oracle

  • UNSUPPORTED : The way it works Apache with OC4J via AJPV13 with mod_jk

    RDBMS Version: 8.1.7.x
    Operating System and Version: SUSE Linux 7.2 / Win NT/2k/XP
    Product (i.e., OAS, IAS, etc): 9ias 1.0.2.2 OC4J 9.0.2.0.0
    Product Version:
    JDK Version: 1.3.1
    Error number:
    UNSUPPORTED : The way it works Apache with OC4J via AJPV13 with mod_jk
    We dont want to use the lame and old mod_jserv so we want to use oc4j but in connection with Apache.
    This is like mod_oc4j in the Oracle 9ias Release 2
    This guide is for advanced users !
    Step-by-Step :
    1) get Tomcat 3.3 for linux or nt with Apache module mod_jk
    http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/
    2) add mod_jk module to httpd.conf (9ias) and comment all mod_jserv, dms, oproc, ojsp ....
    LoadModule jk_module libexec/mod_jk.so
    Include mod_jk.conf
    3) edit mod_jk.conf
    JkMount /*.jsp ajp13
    JkMount /servlet/* ajp13 JkMount /servlets/* ajp13
    <Location "/WEB-INF/"> AllowOverride None
    deny from all
    </Location>
    3) edit workers.properties
    workers.tomcat_home=/opt/oracle/ias/oc4j/j2ee/home
    workers.java_home=/usr/java
    worker.list=ajp13
    worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13
    4) edit http-web-site.xml (oc4j)
    <web-site host="localhost" port="8009" protocol="ajp13" display-name="Oracle9iAS Containers for J2EE HTTP Web Site">
    5) start oc4j
    java -verbose -jar oc4j.jar
    6) start apache (look in error_log)
    apachectl startssl
    7) try to request a jsp page or servlet ..
    http://localhost:7777/test.jsp
    8) good luck it works fine .. !!
    Matthias Roth
    Technical Manager
    Z|rich Investmentgesellschaft mbH
    [email protected]

    Thanks for the tip Mathias, it's always good to see people trying out experimental things with the products.
    We're providing a new module (mod_oc4j) with our Oracle9iAS Release2 product to do this directly from the Oracle HTTP Server (Apache). We've re-written bits and pieces of the module to improve it's performance. Likewise, we've also integrated mod_oc4j with our HA story so it will be notified when new OC4J instances are brought online or if existing ones go down, enabling it to actively route requests around the available OC4J instances.
    Thanks again!
    -steve0

  • Using rownum in EJB-QL ..Pagination using CMP 2.1

    Hi ,
    Hope this is the right forum .. rather than JDBC .
    My requirement is to implement Pagination using EJB2.1 on weblogic with Oracle DB. This is for an application which is quite old system and is not ready yet to be migrated to EJB3.0. So we are struck with EJB2.1 at the moment.
    We are using EJB-QL to get Search result and now need to add Pagination logic in it. I can find weblogic.ejb.PreparedQuery.setMaxElements() API to specify the upper limit but what am looking for is a lower limit ..somthing like setFirstRow() ..
    Can it be done using CMP Entity Bean 2.1 .. EJBQL or someother way ?
    I have the sql for pagination but am not sucessful in translating it to EJB-QL
    select * from
    select /*+ FIRST_ROWS(n) */ a.*, ROWNUM rnum from
    (your_query_goes_here) a
    where ROWNUM <=:MAX_ROW_TO_FETCH
    where rnum >= :MIN_ROW_TO_FETCH;
    Thanks in advance ! I hope I get a solution soon ..
    Edited to get some answers !!!
    is it possible to use rownum in EJBQL ? I know rownum is specific to Oracle and my application will stay with Oracle. I get this exception
    "EJB QL compilation encountered error: [EJB:013042]The Identifier 'rownum' is neither a cmp-field nor a cmr-field. Re-examine your query."
    Edited by: user11305835 on Oct 12, 2009 10:48 PM

    Beevin
      Both two are not even validated,
      but with the first one as select max(c.id) from customer as c , in this case it is validated but while deploying it is error as , object must be return
      But when i saw  the ejb2.1 specification we can write this type of queries also ?
      Is it problem with was any thing
    Regards
    Somaraju

  • How to use CMP with Inheritance?

    I've a thorny problem with 2 EJBs which I hope I can use CMP for persistence.
    I'm supposed to implement a web-based forum and I'm thinking of using a ForumThread entity bean and a ForumReply entity bean to store the postings/messages in the forum.
    A ForumReply, according to OO design, is the same as a ForumThread (which is the first message of a topic) except that they've a parent thread/reply. So I thought of using Inheritance with the ForumThread as the parent (base) class and ForumReply as the sub (derived) class.
    But it seems that CMP in EJB 2.0 does not support this relationship as yet. Is there any way to workaround this limitation without having to remodel the relationship? What should I do in such a situation? Anyone care to share how he overcome this?
    It's not quite possible to give up inheritance in OO design simply because EJB 2.0 CMP doesn't support it right? We end up creating bad softwar design.
    So do I have to go back to using Bean Managed Persistence in this case?

    I hate CMP. Why don't you use JDO or Hibernate?
    Anyway, if you want to do it with CMP, here is your solution: http://www.theserverside.com/resources/article.jsp?l=EJBInheritance

  • Is there any way to use RUN button to deploy the application and open IE...

    Hi
    Thank you for reading my post
    i used to use Run button to compile / deploy and run (opening the browser to project context path) .
    i want to know is there any way to use RUN button to deploy an application to standalone OC4J and opening browser?
    I know that we can define ear or war deployment profiles and use them to deploy the application to stand alone server , but i want a single click solution.
    thanks

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • FAQ: Revel Transition basics: How does this affect the way I use my Adobe software?

    Q: How will this change the way I use my Elements software?
    A: Once you have migrated your files from Photoshop.com to Revel, it will be no longer be possible to sync your photo and video files between your Photoshop Elements Organizer and Photoshop.com.
    If you're using Photoshop Elements 11, you can share your JPEGs from the Elements Organizer to AdobeRevel.com.
    If you’re using Photoshop Elements 10 or earlier version, you won’t be able to directly import from Revel or export to Revel.
    Q: How will this change the way I use Photoshop.com?
    A: Photoshop.com accounts will be remain accessible until the end of the transition period CLICK HERE to see dates and details, but once we begin moving your photos to Revel you will no longer be able to upload photos to your Photoshop.com account.
    After the transition period CLICK HERE to see dates and details, all Photoshop.com accounts will be closed. The Photoshop.com website will remain live and continue to offer product information, trial software downloads, photo editing functionality, customer spotlights, tutorials, and other resources.

    very_nice wrote:
    The suggested advice in this support article http://support.apple.com/kb/HT1478 wasn't a help at all, because the option "enable disc use" in the summary window of itunes doesn't appear.
    *From the article*:
    Products Affected
    iTunes 7 for Mac, iTunes 7 for Windows, iPod nano, iPod shuffle, iPod mini, iPod, iTunes 8 for >Windows, iTunes 8 for Mac
    No mention of the Touch, it works differently from other iPods and has no "disk mode" as such.
    I think it can be used as a storage device by using a 3rd party App, search the the App Store for such items.
    Photos transferred to your Touch via iTunes will be of severely compromised quality i.e 640x480 pixel resolution and file size around 600-700 kb. These can be retrieved, again using a 3rd party application on your computer, such as [Touch Copy|http://www.wideanglesoftware.com/touchcopy> but you will not get back original quality images.
    Good luck,
    Dud.

  • Is there a way to use an adapter to connect my ipad to a USB keyboard and to an ACDC for power

    I have a tablet keyboard with a male USB plug attached to it and it came with an adapter with a female USB on one end and a mini male USB on the other end. I was wondering if there is a way to use that keyboard with my iPad and iPod? There are adapters that plug into laptops and pc's that you can plug keyboards and mice into. Will it work if I plug the iPod or iPad  into one and the keyboard into one and then plug one into the ACDC power adapter (since I am sure the keyboard will drain the battery quicker). I am so tired of the iPad keyboard always hiding what I am trying to type.

    As far as I know, there isn't any support for USB keyboards. THe iPad is designed to work with blue tooth ones.
    That power issue that you state is why it likley won't work. An update in 2011 reduced the amount of power allocated to the charging port and I don't think it's capable of outputting enough to run a keyboard.

  • Is there a way to use a statically defined appearance stream in a dynamically created annotation?

    Hello,
    I want to create a document with cascading 'popups'.  Not the built-in text-only popup, but an annotation containing an appearance stream that defines text and images.  I'm currently using widget annotations based on a pushbutton field.
    Each page in my document has many citations that refer to other pages in the document.  When a user hovers over the citation, I want a 'popup' to appear containing a depiction of the destination.  However, as the destination will itself have citations, I also want the 'popup' to contain citations that the user can hover over, triggering another popup, etc.  In this way, a user could navigate throughout the document without leaving the page or even clicking the mouse.
    Obviously, with even a modest number of citations per page, pre-calculating and statically defining all of these widgets causes a combinatorial explosion, making the document sluggish and very large.
    Instead, I'd like to statically define appearance streams once per document, and then dynamically create annotations and assign the appropriate appearance stream using JS as the user navigates.
    So far I've created a named AP in the names dictionary, but I haven't been able to use it to dynamically set an appearance stream of a dynamically created widget annotation.
    Also, I've called Doc.getIcon(), passing in the named AP, which returns an Icon object.  However, after field.buttonSetIcon() and passing in the named AP, the button does not display the icon.
    Is there a way to use a statically defined appearance stream in a dynamically created annotation?
    Thank you,
    Dave

    Hi George, I've gotten named APs to work, and I expect hidden buttons will follow.  Thank you very much!
    Quick follow-up - I will have many documents embedded within the same pdf file, and some of these documents will contain identical popups.  However, I don't want to store identical icons in each document on account of file size.
    Instead, I'd like to store one instance of each icon for all documents in the file.
    Can I store all of the icons in a single document, and then access them by calling <DocName>.getField().getIcon() from any document in the file?
    Thank you again,
    Dave

  • My MacBook Air does not have an optical drive.  I have a program (Megastar V) which is installed using a CD.  Is there a way to use the optical drive on my PC laptop to install this program on my MacBook Air?

    MacBook Air does not have an optical drive.  There is a program I wish to install on my Air which is an astronomy application called Megastar V.  Installation requires the use of a CD.  Is there a way to use the optical drive on my PC (toshiba laptop using Windows 7) to install this program onto my Air?
    With gratitude,
    Otto

    Thank you for explaining to me how to do this.  I will try it tomorrow and let all of you know how it goes.
    Otto

  • Is there a way to use the iMac's display mode with a Mac mini with out logging in first on the Mac mini

    Is there a way to use the iMac's display mode with a Mac mini with out logging in first on the Mac mini (late2014)
    im currently useing my Mac mini as a portable computer, I take it to the university and use the iMacs there as a monitor but before I can do that I have to log in to my Mac mini first which means doing it blind
    is there a way to put the IMacs into display mode with out logging into my Mac mini first
    or is there a portable monitor that I can use that will not require me to login first

    This
    Target Display Mode: Frequently Asked Questions (FAQ) - Apple Support
    says:
    How do I enable TDM?
    Make sure both computers are turned on and awake. 
    Connect a male-to-male Mini DisplayPort or ThunderBolt cable to each computer.
    Press Command-F2 on the keyboard of the iMac being used as a display to enable TDM.
    Note: In Keyboard System Preferences, if the checkbox is enabled for "Use all F1, F2, etc. keys as standard functions keys," the key combination changes to Command-Fn-F2.
    How do I exit TDM?
    To leave TDM, press Command-F2 on the keyboard of the iMac that is in TDM. You can also exit TDM if you shutdown or sleep either computer or detach the cable.
    Can I use a third-party keyboard or older Apple keyboard to enable TDM?
    Some older Apple keyboards and keyboards not made by Apple may not allow Command-F2 to toggle display modes. You should use an aluminum wired or wireless Apple keyboard to toggle TDM on and

  • Any way to use cursor values inside other cursor by bulk collect?

    hi,
    Is there any way to use cursor get_tables value insdide loop get column if i am using bulk collect in both cursors?
    I tried a lot but i am nt able to do it.kindly help...
    create or replace procedure MULTIPLE_CURSORS_PROC is
    v_owner varchar2(40);
    v_table_name varchar2(40);
    v_column_name varchar2(100);
    cursor get_tables is
    select distinct tbl.owner, tbl.table_name
    from all_tables tbl
    where tbl.owner = 'SYSTEM';
    cursor get_columns is
    select distinct col.column_name
    from all_tab_columns col
    where col.owner = v_owner
    and col.table_name = v_table_name;
    begin
    open get_tables;
    loop
    fetch get_tables into v_owner, v_table_name;
    open get_columns;
    loop
    fetch get_columns into v_column_name;
    end loop;
    close get_columns;
    end loop;
    close get_tables;
    end ;

    hi there
    Refer this
    CREATE OR REPLACE PROCEDURE MULTIPLE_CURSORS_PROC
    IS
       TYPE scol IS VARRAY (10000) OF VARCHAR2 (32767);
       v_table_name    scol;
       v_column_name   scol;
       TYPE curtyp IS REF CURSOR;
       get_columns     curtyp;
       CURSOR get_tables
       IS
          SELECT   DISTINCT tbl.table_name
            FROM   all_tables tbl
           WHERE   tbl.owner = 'SYSTEM';
    BEGIN
       OPEN get_tables;
       LOOP
          FETCH get_tables BULK COLLECT INTO   v_table_name;
          FOR indx IN v_table_name.FIRST .. v_table_name.LAST
          LOOP
             SELECT   DISTINCT col.column_name
               BULK   COLLECT
               INTO   v_column_name
               FROM   all_tab_columns col
              WHERE   col.table_name = v_table_name (indx);
             FOR ind IN v_column_name.FIRST .. v_column_name.LAST
             LOOP
                DBMS_OUTPUT.put_line (v_column_name (ind));
             END LOOP;
          END LOOP;
          EXIT WHEN get_tables%NOTFOUND;
       END LOOP;
       CLOSE get_tables;
    END MULTIPLE_CURSORS_PROC;regards
    Hitesh

  • Any way to use filter to exclude tables in navagation pane?

    Is there any way to use filter to exclude a set of tables from the table list in the navagation pane? I have a number of tables (15+) starting with the same prefix eg. AB123 that I would like eliminate from the list. They sort right to the top and I always have to scroll down, and go through the show more dialog to see the entire list.
    I am sure I'm missing something, but not sure what. Help Center has nothing to offer.
    Thanks
    Glenn

    This has been mentioned on the forum before - basically the need for more elaborate ways to filter (multiple conditions as well as 'not like'). It is on our list for future consideration, meaning post-production.
    -- Sharon
    Message was edited by:
    sbkenned

  • HT1541 is there a way to use my itunes credit to send a gift card? i have credit from gift cards on my account and would like to gift some of it to someone else.

    Is there a way to use my itunes credit to send a gift card to someone else. I have credit on my account and would like to gift some of it but cannot figure out how to use the credit to do so. It appears I can only send a gift by charging to my credit card.

    You cannot use gift balance for gifts.
    Sorry

  • Is there a way to use iPhoto and *not* have it import photos?

    Hi there,
    I'm transitioning from a PC to a Mac and everything is going fairly well -- overall a better user experience. One question I have is, is there a way to use iPhoto without having it import photos? My main issue is that currently iPhoto imports all the photos that I want to view/edit in iPhoto and copies them to it's own folder structure. I like to manage my pictures in a folder structure that I define, so I already back up my photos to another location and now I'm finding that iPhoto is just duplicating the pictures that I already have where I want them, sucking up precious space on my SSD.
    So is there a way for me to just point iPhoto to a folder, make my edits on those photos, and have iPhoto automatically save those changes to the original folder I pointed it to, instead of duplicating the photos in it's own folder structure?
    It occasional things like this that makes me miss some Windows features. In this case, I miss Windows Photo Gallery.

    Hm, ok so if I edit my photos (adjust brightness etc) in iPhoto and then export it, does it export with the brightness changed, or does it just export the original?
    It exports whichever you choose - the edited version or the original.
    However, am I the only one with trust issues with importing all my photos into iPhoto? I'm scared the library will get corrupted, etc.
    NO you're not the only one. The protection against any data corruption is a good back up, and you need that for any data on any computer running any OS. But in the case of iPhoto, remember too that the original files are stored exactly as they are imported, in folders, in the filing system.
    that when I go to export the photos, there's a LOT of duplicate file names that the export chokes on, which makes it very tedious, no, painful, for me to export a large number of photos.
    Explore the options under File Name when you export from iPhoto using the File -> Export command
    Regards
    TD

Maybe you are looking for

  • How to write conversion routine for key figure?

    Our customer has this requirment: we need to know the last time of some TV program in BEx report, If a TV program last 500 seconds, we need show the key figure like this:  00:08:20, If a TV program last 100000 seconds, we need show the key figure lik

  • Cannot Preview Pics Anymore

    Hello, I can't believe I'm logged into the forum - it only took 30 minutes. (Why does it say your username is taken, when it's YOU who has taken it?) Anyhow, starting last week, I can no longer view my pics in Lightroom. Except for the grid view, all

  • Fail to install itunes 7.0.1

    Please Help! I've spent the last two days struggling with installing the latest version of itunes and miserably failed! I've already removed the old version of itunes and quicktime. But when I downloaded quicktime 7.1.3, it said I've already got a mo

  • Re: Resource files

    I have recently installed the adobe creative suite cs4, upon attempting to load illustrator cs4 I am presented with a message which claims the localized resource files could not be loaded. I have restarted my computer, and tried to reinstall illustra

  • Service account in MDS installation error

    Dilip Patil..