Triggers and EJB ?

I have an EJB container managed, and I want to add an entry with an ID that is normally set by a BEFORE INSERT trigger. That trigger ask a sequence and set the ID.
Unfortunately, the EJB is always try to add ID = 0, even if I don't set the ID. Is it a bug of Oracle8i, or is there a way to fire automatically the trigger ?
Thanks
cyril ZEKSER

LuckyJim1006 wrote:
No triggers created by me, no. ( I would have no idea how to :-) )
This is where my inexpierence shows. All I have from them are the statements above.
All I have done is a whole bunch of SELECT statements, an INSERT script I wrote to populate an empty table with lookup values and a single DELETE statment on a test row of data.Was this empty table an important table in production environment or was it a test table that you had created?
If it was important from production point of view, you should be reverting the changes that you have done (inserts, updates and delets).
If it was a test table that you only had created, I don't think it will have anything to do with the database becoming "corrupt" as per software supplier.
Am I correct in saying that Triggers are fired irrespective of the software used to to access the database ?
So no matter if it's SQL*Plus, SQLDeveloper, a Java app or an Oracle Forms app the Triggers still fire.Yes. Triggers fire for an operation against a table; the operation source can be anything.
>
And do Oracle objects (tables etc) actually need to be 'recompiled'Only the stored executable units (like procedures, functions, triggers, packages) need to be compiled. Tables cannot be compiled.

Similar Messages

  • Diff b/w bc4j model and ejb model in adf11g

    hi all,
    iam murali iam new for adf 11g i have some dout's in adf11g ,can u please solve my probleam
    what is the difference b/w bc4j componet and ejb componet,how to develop ejb application in adf11g.

    ,how to develop ejb application in adf11gTake a look at this tutorial for starters:
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ejb/ejb.html

  • JDBC, JMS and EJB transactions - possible problem?

    Hello,
              I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
              XDoclet.
              In my current project I have the following piece of code
              in one of my message driven beans (code cited as pseudocode
              without unnecessary details):
              * @ejb.bean name="MyMessageProcessor"
              * display-name="Display name for a MyMessageProcessor"
              * jndi-name="ejb/MyMessageProcessor"
              * description="Bean MyMessageProcessor"
              * destination-type="javax.jms.Queue"
              * transaction-type="Container"
              * acknowledge-mode="Auto-acknowledge"
              * subscription-durability="Durable"
              * generate="false"
              * @ejb.transaction type="Required"
              public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
              public void onMessage(Message msg) {
                   try {
                        //obtaining connections to two different databases via JNDi
                        java.sql.Connection connOne =
                        ((DataSource)ctx.lookup("DataSourceOne")).getConnection();          
                        java.sql.Connection connTwo =
                             ((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
                        // performing some UPDATEs and INSERTs on connOne and connTwo
                        // calling some other methods of this bean
                        //creating the reply JMS message and sending it to another JMS queue
                        Message msgTwo = this.createReplyMessage(msg)
                        this.queueSender.send(msgTwo);
                        //commiting everything
                        this.queueSession.commit();          
                   } catch (Exception ex) {
                   try {
                        if (this.queueSession!=null) this.queueSession.rollback();
                   } catch (JMSException JMSEx) {};     
                   this.context.setRollbackOnly();
              Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
              connection pool with non-XA jdbc driver. Everything worked fine
              including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
              to database and the incomming message was thrown back to the my bean's
              queue).
              When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
              participate in a global transaction. When I changed both datasources
              to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
              EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
              and the JMS message wasn't resent to the JMS queue.
              So here are my questions:
                   1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
                   Are there any global server configurations, which may influence this situation?
                   2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
                   (of course, if necessary)?
                   3. Are there any JMS Queue settings, which would disable the container to send message back to the
                   queue in case of setRollbackOnly()? How should be the Queue configurated?
              As I am new to the topic and the deadline for the project seems to be too close I would be grateful
              for any help.
              This message was sent to EJB list and JDBC list.
              Sincerely yours,
              Marcin Zakidalski

    Hi,
              I found these information extremely useful and helpful.
              The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
              Anyway, I still have some problems. I have made some changes to the
              code cited in my previous mail. These changes included changing QueueSessions
              to non-transactional. I also set the "Honorate global transactions" to true.
              I am using XA JDBC driver. After setting "Enable local transactions" to false
              (I did it, because I assume that JDBC transactions should be part on the global
              EJB transaction) I got the following error:
              java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
              driver supports performing SQL operations with no global transaction, explicitly allow it by setting
              "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
              transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
              complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
              I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
              the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
              My questions are as follows:
              1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
              thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
              from doing that? Can using setAutocommit(true/false) change the situation for better?
              2. How to encourage the JDBC driver to be a part of EJB transaction?
              3. As I have noticed each of ejb method has its own transactions (transactions have different
              Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
              way that if already started transaction exists it is used by the called method?
              4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
              impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
              enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
              solved programmically?
              Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
              I am loosing the ability to perform all actions in one transaction.
              Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
              Marcin

  • OC4J 9.0.3 and EJB 1.1 deployments???

    I can not deploy my ejb1.1 beans on 9.0.3 container.
    OC4J crashes with an XML parse error as a null pointer exception.
    If I remove my O-R mappings from my orion-ejb-jar.xml file, the container starts up ok (app wont run as it needs the mappings)
    9.0.3 docs claim I should be able to use my 1.1 ejb in this ejb 2.0 container.
    Solaris release notes for 9.0.3 claim I must migrate to ejb2.0
    Someone else posted this same question but got no replies.
    Anyone else deployed ejb1.1 with OR mappings in 9.0.3 successfully yet?
    thanks

    I have tried migrating to an ejb2.0 set of beans and ejb-jar.xml file.
    With no <query> tags installed for my finders I notice that a typical finder produces this:
    <!-- Generated SQL: "select Isp.isp_Id from Isp -->
    This is vastly different from the 1.1 orion-ejb-jar.xml which would list ALL column names in the finder - hence how am I going to do a findAll? The currently generated sql is way off. Deployment of the "ormap" demo also shows a lack of column names in the generated SQL finder methods in orion-ejb-jar.xml.
    Further, as soon as I introduce the query in the 2.0 version of ejb-jar.xml, the container dies with a null pointer exception. Removing this from the ejb-jar and bean deploys. Useless, cause theres no finders though.
    Also, attempts to add to the <finder-method query=...> tag yield container crashes with null pointers too.
    This is not very robust to say the least. Can you provide names of jar files that would cause such exceptions?
    When NO query tag is inserted in the ejb-jar file, attempts to run a sample client using findByPrimaryKey return successfully but use of findAll causes timeouts similar to whats described in
    "finders giving "timeout expired waiting for an instance" after 0, 1, or 2 calls" in this same forum.
    Heres the query out of the ejb-jar.xml file...
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params></method-params>
    </query-method>
    <ejb-ql>
    SELECT OBJECT(o) from IspTb o
    </ejb-ql>
    </query>
    IspTb is the <abstract-schema-name> Tables exist in db.
    The full error...which prevents deployment of the ejbs and hence no rewrite of the orion-ejb-jar file.
    =========
    10/23/02 1:54 PM: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
    10/23/02 1:54 PM: java.lang.NullPointerException
    10/23/02 1:54 PM: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
    10/23/02 1:54 PM: at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:135)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
    10/23/02 1:54 PM: at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:135)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getClass(PersistenceDescriptor.java:767)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getStateClass(PersistenceDescriptor.java:753)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getCMPFieldType(PersistenceDescriptor.java:1302)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.initializeFieldInfo(PersistenceDescriptor.java:1052)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getPersistentFieldInfo(PersistenceDescriptor.java:805)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.<init>(SQLGenerator.java:151)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:360)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:309)
    10/23/02 1:54 PM: at com.evermind.server.ejb.deployment.EJBPackage.translateEjbqlQeries(EJBPackage.java:2100)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.translateEjbqlQeries(Compilation.java:140)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:178)
    10/23/02 1:54 PM: at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:551)
    10/23/02 1:54 PM: at com.evermind.server.Application.postInit(Application.java:431)
    10/23/02 1:54 PM: at com.evermind.server.Application.setConfig(Application.java:136)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1635)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1585)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1240)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
    10/23/02 1:54 PM: at java.lang.Thread.run(Thread.java:479)
    10/23/02 1:54 PM: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getClass(PersistenceDescriptor.java:770)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getStateClass(PersistenceDescriptor.java:753)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getCMPFieldType(PersistenceDescriptor.java:1302)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.initializeFieldInfo(PersistenceDescriptor.java:1052)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getPersistentFieldInfo(PersistenceDescriptor.java:805)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.<init>(SQLGenerator.java:151)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:360)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:309)
    10/23/02 1:54 PM: at com.evermind.server.ejb.deployment.EJBPackage.translateEjbqlQeries(EJBPackage.java:2100)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.translateEjbqlQeries(Compilation.java:140)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:178)
    10/23/02 1:54 PM: at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:551)
    10/23/02 1:54 PM: at com.evermind.server.Application.postInit(Application.java:431)
    10/23/02 1:54 PM: at com.evermind.server.Application.setConfig(Application.java:136)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1635)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1585)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1240)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
    10/23/02 1:54 PM: at java.lang.Thread.run(Thread.java:479)

  • Function and triggers and procedures

    sorry to asking this question,
    In oracle. we use the function and triggers and procedure.
    for eg:
    if we wrote an trigger for a table. it fires at a time manipulating table. (database contains table contains datas and database also contains triggers likewise function,procedure).
    but my questions?: is
    In my database I kept only tables. no triggers,no function,no procedures. and
    i dont want to kept this triggers, function, procedures in database  Instead of i want to kept this triggers, function, procedures in business logic layers(middle tier)
    is it possible? .
    if yes means, how to write or where to write? please help me, or else send the guidance documents or blog releated to it.

    Subu123,
    the +1 related to Would be great if you can take step back and see the implementation from another angle. First see why do you need DB trigger/function etc.Then check whether it is possible to implement the functionality using ADF BC + feasibility study between 2 approaches(I didn't mean to invoke DB objects from business components, instead checking the feasibility of implement the same functionality in your EntityObj/ViewObj/Service calls )Before making a decision for or against holding fuctions, triggers and procedures in the DB, you have to get the whole picture.
    Think about a trigger outside the DB. What could this be and why or for what is it used?
    All the answers are pointing to 'lets keep them in the DB'. Now there are situation where you don't have a DB or are not allows to use it. Still there can be triggers, only they are implemented in a different way.
    The same can be said for procedures and functions.
    So you have to think about the whole problem and how each sub problem you have to solve work together to resolve the whole problem.
    I'm personally tend to keep the business logic the the DB if the business logic is already there (e.g. I have to migrate an old forms app).
    If I design a new app I tend to keep the logic in java. Only sequences (for generating ids) and some other stuff which is purely db related like cleaning up tables I keep in the DB.
    Timo

  • ABAP Objects and EJB

    Hi every one,
    Can <b>ABAP Objects and EJB</b> be compared?
    -Naveen.

    Hi Naveen,
    Check this guide- might be useful-
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/dc09af90-0201-0010-d09b-bd611a11070b
    Regards,
    Moorthy

  • Problem using TAPI triggers and merge statement

    Hi,
    I use Designer tapi triggers on a table. When I try to execute a merge statement, I get the following error:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
    Is there a restriction when using TAPI triggers and merge statements that anyone is aware of?

    No restrictions on MERGE commands that I know of. I have, however, seen the TAPI give inexplicable ORA-06502 errors. It would help to know what line in which procedure or trigger gave the error. That information should have been in the error stack.

  • Using SWING and EJB

    Had nebody used Swing for GUI and EJBs for business logic. HEre i need to use Swing for gui rather than JSPs.
    Can nebody help??

    My question is ...
    How do u call EJBs from swing based applets..
    In J2EE transaction management cud be done at server side but how will we manage with the swing app??

  • How to use analog Triggering and External clock scan

    Hi, there. I want to measure the engine cylinder pressure with an PXI6070-E card and BEI encoder. I have tried using Cont Acq&Graph ExtScanClk D-Trig.vi and Cont Acq&Graph ExtScanClk Soft A-Trig.vi , but they don't work. What I did was to connect a 50HZ pulse to PFI0 (analog triggering, I changed the code from digital triggering to analog triggering), and a 100K pulse to PFI7 (startscan), and an 50 HZ analog signal to ACH0. But the code always says: timeout. If I use internal clock, it works fine. Could you please give me some help? THANKS A LOT!

    Hey Wyuan,
    I tested the Cont Acq&Graph ExtScanClk Soft A-Trig.vi and it worked fine. However, the Cont Acq&Graph ExtScanClk D-Trig.vi has a small error in its logic that will prevent the data from ever being displayed to the graph. In order to run the examples you need to connect a trigger to pin 11 and a scan clock to pin 38. A 10kHz square wave would be fine for the clock signal and just a single pulse would work for the digital trigger.
    One additional think to keep in mind is the grounding. You might need to connect you ground from your signals to a DGND pin. I am including the two programs that I used for the test.
    I hope this helps,
    Joshua
    Attachments:
    Cont_Acq&Graph_ExtScanClk_D-Trig.vi ‏121 KB
    Cont_Acq&Graph_ExtScanClk_Soft_A-Trig.vi ‏153 KB

  • OC4J EJBQL and EJB 2.0 features

    Hello Debu Panda and All
    I've got all howtos and I mangaged to get some parts of OC4J [Oracle9iAS (9.0.3.0.0) Containers for J2EE (build 020323.1689)] working.
    There are still some issues that are stalling our development. Could you please comment on them, maybe providing an estimate of when they will be solved/implemented?
    First of all, a little background. Our application uses many Java Swing application clients that connect to the EAR application in the container.
    The ear application has the following structure:
    All database access (Oracle 8i, located in its own server) is done exclusively by means of CMP entity beans. A entity bean may access other entity beans. There are workflow session beans (stateful and stateless) that access the entity beans. All clients see only the workflow session beans (session beans fagade).
    Our applicatoin is complex, having more than 80 session beans and more than 25 entity beans (not counting entity beans that exist only to represent relationships among entity beans).
    There goes the questions:
    1) It seems that entity beans cannot currently be referenced by remote interfaces. We couldn't deploy our application using it. Since we could use only local interfaces fot entity beans, thats what is been done now.
    2) There is no CMR supported. Is this true?
    3) EJBQL seems to be very limited. In the howto examples there are EJBQL statements that compare two numbers. However, when we tried to use String comparisons, it didn't work. Here is the statement:
    "SELECT DISTINCT OBJECT(p) FROM Person p WHERE p.name = ?1"
    If I compile, package and deploy the ear applicatin with the above EJBQL statement, OC4J generates an exception when executing the finder method. The exception is:
    "java.rmi.NoSuchObjectException: Session has timed out
    at com.evermind.server.ejb.StatefulSessionEJBObject.throwPassivisat
    ception(StatefulSessionEJBObject.java:188)
    at Cad023Remote_StatefulSessionBeanWrapper0.obterPessoasPorParteNom
    023Remote_StatefulSessionBeanWrapper0.java:754)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:8
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)"
    If I remove the where clause, the expection is gone. However, I get all records. ;-)
    4) It seems that all EJBQL clauses must be capitalized. Is this true?
    FINALY)
    Is there a newer OC4J build that could use to get the development going? Do you know where there will be one? Is there any way of contacting the OC4J development team to report bugs?
    If you would like, we could discuss it in private e-mail (please use my private mail [email protected]).
    Thanks for your attention,
    Luis Fernando Soeiro
    Hi !! OC4J 9.0.3 developer's preview has most features of EJB 2.0. We are working on updating on our docs and samples for EJB 2.0
    Please look at the following URL that has some How Tos on EJB 2.0 features such Local Interfacea, EJB QL, etc : http://otn.oracle.com/tech/java/oc4j/htdocs/oc4j-how-to.html#ejb
    regards
    Debu Panda
    Oracle --------------------------
    Luis Soeiro <mailto:[email protected]> <mailto:[email protected]>Type : Question Date : Apr 11, 2002 15:15 PT Hello
    Some colleagues and I are trying to port a large project from JBOSS to OC4J. We used JBOSS 3.0 (beta) in order to evaluate EJB2.0 features and see if we could use it. We already have OC4J in production, but only as a JSP/Servlet container. The next step would be to deploy our EJB application to OC4J.
    We have read the material and it is written that OC4J (developers preview) is EJB 2.0 compliant. However, the specific documentation and the examples don't show how to specify OC4J specifc XML files. We absolutely need CMR and Local Interfaces, because we don't have the time required to downgrade our JBoss EJB2.0 application to the EJB 1.1 specification. We have over 80 Session Beans and over 20 Entity Beans.
    Is there anybody there that can confirm that OC4J developer's preview is really EJB2.0 compliant? If so, could you send me some pointers to information about OC4J container specifc deployment descriptors? The docs listed at the web site don't have EJB2.0 features listed, nor does the Oracle samples.
    Thanks for your attention,
    desperately,
    Luis Fernando Soeiro

    HI,
    I worked out CMR and EJB-QL with single bean.
    Using CMR, it is possible to get one bean reference through other bean, but
    When I tried EJB-QL with bean to bean navigation then I run into problem.

  • Global transactions in OSB and EJB 2.1

    Hi,
    My team is working in a SOA service based on OSB 11g (11.1.1.5) using DB JCA Adapter and EJB 2.1 over WLS 10g(WLI environment). The logic of the service works in this way:
    1. A table in a database (XE) is polled by the DB Adapter which starts the service (1 row = 1 message).
    2. The message contains a collection of items to be inserted in another Oracle database.
         Once a message/row is picked, and after some steps (logging, validation,etc), there is a for..each action which extracts each item of the collection and executes a service callout action to a business service.
    3. This business service uses EJB protocol to call an EJB (2.1 + WLS Extensions). The EJB is deployed in another domain (WLS 10.3.0/10g and Oracle BEA drivers)  and only executes an store procedure with the parameters based on the message and inserts these values in a table.
    4. Once the for...each finishes, there is a call to another proxy service which marks the message/row as "processed" in the source table. This update is done via DB JCA also.
    5. In case of an error, the error handler of the proxy service calls the proxy service mentioned above to mark the row as "Failed" (in fact there is a retry mechanism, but it's not important for now).
    The service requires to work inside a global transaction. The main requirement is that the collection of items should be processed as "All or None", so basically we're using the options to manage the global transaction. However, the problem is that it's failing to rollback the whole insertion of items when an error is simulated. It only rolls back the last insertion/execution of SP.
    Additionally, the proxy service that should mark the row as FAILED, never updates this one, and the tables stay locked until we modify one of the store procedure in order to avoid the simulated error and commit the transaction.
    The EJB uses WLS extensions with the annotations to "transaction required". The proxy service has the option transaction required also. The database drivers are all XA and we're testing against Oracle11g XE (however, the EJB destiny will be Oracle 8i in production).
    We have tried different alternatives, splitting the logic in different proxies (Proxy services for JCA, Proxy with For Each for EJB, etc), isolating the specific part with the EJB call, without success.
    The security between domains is set as Global Trust.
    Do you have any idea, example or suggestion about this problem? Is EJB really supported in Global Transactions and XA?
    Thanks in advance.

    where do you find the J2EE Connector 1.5 compliant
    Resource Adapter?I wrote the compliant adapter myself. Hey Steve,
    Were you able to find a solution for this problem. I am struggling with the same problem with the RI Beta implementation.
    Sandeep

  • Sql query to  know the number of triggers and cursors present in a schema?

    friends,is there any way to know the number of triggers and cursors preseent in a schema.
    thanks in advance..

    what do you mean by triggers in a schema? is it the triggers owned by that schema? or the triggers applied on tables owned by that schema? remember you may own triggers applied on the tables belong to other schemas. Anyways, all this information can be extracted from oracle dictionary using a combination of all_triggers and all_tables.
    As far as cursors, please elaborate. Do you mean cursors declared in PL/SQL blocks?

  • ADF and EJB. Why so little samples / information

    Hi All,
    I was wondering if other JDev / ADF developers have the same feeling as me in regards to ADF / EJB.
    There is barely enough information and examples on using ADF with EJB. Seems that most examples and blogs are related to BC instead.
    I was reading an article (sorry, don't have the link to it) not long ago that an Oracle Executive was asked if BC or EJB was Oracle's future and EJB was the answer. However, that doesn't seem to be the what most blogs and sample are about.
    I know that BC has tight integration with ADF, but it's not a standards based back-end framework. We are locked in the ADF UI for all of our development, but not touching BC at all. All code is EJB compliant.
    So, my request is:
    - comments? do other developers out there feel the same way?
    - bloggers, the great articles from "Frank Nimphius" and "Andrejus Baranovskis", not to mention others, can you guys post a little more on using ADF with EJB?
    BTW: great article on that "http://www.oracle.com/technology/products/jdev/tips/fnimphius/ControlHintsWithPojos/controlHintsWithPojos.html" (How-to find and set control hints on POJO entities in bean Data Controls)
    Thanks and Regards
    Jonny Oenning

    Hi!
    I rised this issue long time ago - with TP3 I noticed regression in EJB/JPA support with ADFm (binding layer as referred by Shay). Following the development, I draw this conclusions:
    1. Oracle is oriented toward J2EE standards, including the strategic orientation to EJB/JPA. The team that managed JDev 11g initial development phases was oriented toward EJB (but was replaced/fired sometime between TP2 and TP3).
    2. Oracle decided that FMW 11g stack products as well as EBS migration from PL/SQL to EJB is not feasible in short time frame (I think that was poor judgment). So, the BCs got the push over the EJB and TP3/4 was biased toward BCs. Even the default Fusion technology stack is changed - in TP1/2 the Fusion Web project was ADF RC + EJB buy default and then changed to ADF RC + BC4J. Also the development guides were "rephrased".
    3. As BC4J are proprietary Oracle technology, the are lacking many J2EE standard features and many strong points of the modern multi-tier architecture. Many developers are witnessing the performance / scalability issues as the BC4J are basically a mutant: they are SQL based concept wrapped into EJB for deployment! But they are not relaying on proven scalable J2EE technologies (like JPA/JTA, object caching etc.). They are trying to reinvent the wheel, decalratively offering the heaven of J2EE multi-tear architecture to old fashion SQL-focused architects/developers. But it is just a marketing - the truth is that BC4J are not and cannot be the replacement for proven J2EE architecture. They are trying to mimic the concepts of J2EE (like object-entity mapping, like JTA/JPA, like scalability and caching, transparent web-services exposition etc.) but they are lagging behind even J2EE 1.4 and we are facing the J2EE 6 in few months!
    4. Oracle is aware that EJB is the future but they are trying to bridge the gap between their legacy code written mainly in PL/SQL. So they developed and they are developing the JDeveloper 11g in fashin that should support and serve for their primary goals - migration of their own old PL/SQL based products to new, J2EE, world (of BEA!).
    So, anyone who is expecting the that Oracle JDeveloper is what they are marketing (full scale J2EE IDE) - is going to waste some time and money waiting the Oracle to finish it's half-way migration from PL/QL and Forms/Reports to PL/SQL + ADF RC! In few years from now.
    Thus, if you need efficiency in J2EE standards development - try something else than JDeveloper. Or, as suggested by Shay, don't use overmarketed ADFm as it is not compatible with EJBs in scalable / clustered deployment! Yes, that is proven issue (but I wont elaborate here as it is already well elaborated in this forum in another tread but the Oracle guys wisely neglected that issue).
    And beside few very very old and for me useless blog entries (one of which is not working in 11g as you may read in comments) there will be no much support for EJBs in this release of JDeveloper - I can bet!
    But, as final message to the public, I'm still stuck with JDev and EJBs as. When you develop you own patterns, it is still the best combination for developing the scalable, high performance apps on Oracle FMW 11g platform - mandatory including several grid technologies that are making the difference in scalability of true J2EE apps and quasi-J2EE "Fusion" apps based on BC4Js "silently" wrapped in EJBs for deployment.
    Regards,
    PaKo

  • Using JMX to read ejb manifest jar and ejb-jar.xml in ejb jar inside ear

    Hello,
    I have an ear deployed on weblogic console. I need to check contents of manifest file and ejb-jar.xml of a jar that is present in the deployed ear.
    Currently I am using below code to access jar inside ear deployed :
    Hashtable env = new Hashtable(5);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    url);
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    mBeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    String type = "EJBComponentRuntime";
    Set beans = mBeanHome.getMBeansByType(type);
    try{
    for(Iterator it=beans.iterator();it.hasNext();)
    EJBComponentRuntimeMBean rt = (EJBComponentRuntimeMBean)it.next();
    if(rt.getParent().getName().equals("xxx")){
    System.out.println(rt.getName());
    l.add(rt.getName());
    Here xxx is the ear. Now I need to get inside the jar (represented) by variable rt and access its manifest file,ejb-jar.xml
    Does anyone have an idea how to do this?
    regards
    Sameer

    Isn't it possible to put them there manually? :)

  • SAS9.1 Persistence and EJB lookups (not registered in JNDI?)

    I am trying to deploy a very basic EJB3 module to test my learning. The module deploys via the Admin Console without apparnet error. Unfortunately, when using the generated test page for the web-service, I am having total failure which seems to be around the persistence unit and EJBs not being created in the JNDI.
    I have an @Stateless/@WebService bean:
    package com.flexit.buslogic;
    import java.util.logging.Level;
    import javax.ejb.Stateless;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import com.flexit.persistence.eao.OwnerFacade;
    @WebService
    @Stateless
    public class CreateOwner {
         @EJB
         private OwnerFacade ownerFacade;
         public CreateOwner(){}
         @WebMethod
         public Integer addOwner (
                   @WebParam(name="Name") String name){
             LogUtil.log("Add owner request " +
                        "received for "+name,
                        Level.INFO, null);
            return ownerFacade.findAll().size();
    }The OwnerFacade EJB injection fails with avax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJBIf I instantiate a 'normal' reference to OwnerFacade (ie OwnerFacade ownerFacade = new OwnerFacade(); I get a similar error in the OwnerFacade EJB in relation to an attempt to inject an EntityManager:
    package com.flexit.persistence.eao;
    import java.util.List;
    import java.util.logging.Level;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import com.flexit.persistence.LogUtil;
    import com.flexit.persistence.Owner;
    @Stateless
    public class OwnerFacade implements OwnerFacadeLocal, OwnerFacadeRemote {
         // fields
         @PersistenceContext(unitName="FlexIBuildPU")
         private EntityManager entityManager;
         public OwnerFacade () {
              if (entityManager == null) {
                   LogUtil.log("unable to get an Entity Manager Instance", Level.SEVERE, null);
    ...The constructor logs that the entityManager is, indeed, null.
    I have tried the code on SAS9 and 9.1 and using the default JavaDB and a MySQL connection pool (successful ping) and datasource (named 'jdbc/FlexDBDS') created through the Admin Console. The persistence unit is defined in a persistence.xml file in the META-INF folder:
    <?xml version="1.0" encoding="UTF-8"?>
         <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
              <persistence-unit name="FlexIBuildPU" transaction-type="JTA">
                   <jta-data-source>jdbc/FlexDBDS</jta-data-source>
              </persistence-unit>
    </persistence>Can anyone please save me from tearing my hair out (more)?

    Have managed to resolve. There were two problems
    First I was attempting to access a session bean directly rather than via an interface (eejit!) - ie:
    @EJB OwnerFacade ownerFacadewhen it should have been:
    @EJB OwnerFacadeLocal ownerFacadeSecond, the persistence unit wasn't created properly. In playing around with persistence.xml I moved from:
    <?xml version="1.0" encoding="UTF-8"?>
         <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
              <persistence-unit name="FlexIBuildPU" transaction-type="JTA">
                   <description>This unit manages BMS units, owners, offers, and acceptance.</description>
                   <jta-data-source>jdbc/FlexDBDS</jta-data-source>
                   <properties>
                          <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
                          <property name="toplink.ddl-generation" value="create-tables"/>
                     </properties>
              </persistence-unit>
    </persistence>to:
    <?xml version="1.0" encoding="UTF-8"?>
         <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
              <persistence-unit name="FlexIBuildPU" transaction-type="JTA">
                   <description>This unit manages BMS units, owners, offers, and acceptance.</description>
                   <jta-data-source>jdbc/FlexDBDS</jta-data-source>
                   <properties>
                          <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
                          <property name="toplink.application-location" value="C:\ddl\flexdb\"/>
                          <property name="toplink.create-ddl-jdbc-file-name" value="create.sql"/>
                          <property name="toplink.drop-ddl-jdbc-file-name" value="drop.sql"/>
                          <property name="toplink.ddl-generation.output-mode" value="both"/>
                          <property name="toplink.ddl-generation" value="create-tables"/>
                     </properties>
              </persistence-unit>
    </persistence>It seems the very action of writing the sql to file helps with the binding. It seems so extraordinary that I think I must of made another mistake which was corrected along the way. In any event, the properties specifying output files may prove useful to others. :)

Maybe you are looking for