JMS and JDBC Transaction

I have recently tried using the JMS interface for AQ and I have discovered that the queue connection is a separate JDBC connection even if you create a queue connection using an OracleConnection. Is there a workaround for this? It seems a bit strange to have two connections open to the database and be forced to use an XA session in order to get the commits synchronized. Any ideas ? Below is some sample code I am using:
queueConnection = AQjmsQueueConnectionFactory.createQueueConnection((OracleConnection)connection);
queueConnection.start();
QueueSession queueSession = queueConnection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
AQjmsSession aqs = (AQjmsSession)queueSession;
Queue queue = aqs.getQueue("TEST_SCHEMA", "TEST_QUEUE");

Hello,
What version are you using of the jar files? What version of the database are you using?
From what I recall the example in <Note:301434.1> successfully reused an existing JDBC connection.
I would be interested to see a more complete code example if this is not helpful.
Thanks
Peter

Similar Messages

  • JMS and JDBC Adapter in PI7.1

    Hi All,
    Kindly tell me about the blogs for JMS and JDBC adapter.
    Please tell me about the Message Types in JMS adapter.
    Thanks in advance.

    Hi Shwetambari,
    Thanks for the reply.
    We need to mention the Adapter Modules while configuring the communiucation channels in JMS
    e.g. Adapter/ConvertJMSMessageToBinary,Adapter/ConvertBinaryToXMBMessage etc.
    So please tell me whether we need to write the cide for the same in JAVA or it is already there ?If it is there then whre can we get it?Do we need to decompile the archeve ?If so, then how to do it?
    Can you give me the Adaqpter Modules for which the code is already there?
    The JMS adapter (Java Message Service) enables you to connect messaging systems to the Integration Engine or the PCK.
    What are the different types of Messaging Systems?Or what is meant by the Messaging System in JMS?
    What are the different types of Messages used?
    Thanks in advance.
    Edited by: Shweta Kullkarni on Sep 4, 2009 5:22 AM

  • 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

  • Foreign JMS and Enlisting Transactions?

    I'm working on implementing an XA interface layer to an implementation of a foreign JMS provider and am having a problem with enlisting XA transactions in WebLogic.
              I implemented a simple JNDI that stores and retrieves serialized versions of classes in the local filesystem.
              I create an XATopicConnectionFactory named ambxatcf and a Topic named ChatterTopic and store them in there.
              The XATopicConnection implements XAConnection.
              I put a client jar in bea/weblogic91/samples/domains/wl_server/lib/ which contains the JNDI code and all of my XA classes which call the JMS.
              That gets picked up by the server on startup.
              In the Web Logic Admin Console:
              I create a Foreign Server under JMS Modules, ambrosiaServer.
              I set the JNDI Initial Context Factory set to my JNDI InitialContext class and the JNDI Properties is the path to my JNDI filestore so that it can find the serialized objects.
              I create a Foreign Destination in this server which has a Local JNDI Name: Chatter and Remote JNDI Name: ChatterTopic
              And then also in this server, I create a Foreign Connection Factory, Local JNDI Name: ambxatcf and Remote JNDI Name: XATopicConnectionFactory.
              Then in Deployments, I Install the jar containing my bean and Start it.
              Then I run the client and the bean prints out the XATopicConnectionFactory and it's the one that came out my JNDI.
              I have messages in my XATopicConnectionFactory, XATopicConnection and XATopicSession code so I know they're getting called.
              What's not getting called is XATopicSession.getXAResource() or my XAResourceImpl.start() or XAResourceImpl.commit().
              This happens whether I have the bean set up for bean managed or container managed transactions.
              I'm testing against WebLogic 9.1.
              Thanks,
              Don Hermes

    Hi Tom,
              Thank you for your response.
              I saw the article in the 8.1 documentation but I also found the following in the 9.1 docs.
              So, I assumed it would work.
              Was that assumption wrong?
              Thanks,
              Don
              =====================
              http://e-docs.bea.com/wls/docs91/jms/j2ee.html
              Automatically Enlisting Transactions
              This feature works for either WebLogic JMS implementations or for third-party JMS providers that support two-phase commit transactions (XA protocol). If a wrapped JMS connection sends or receives a message inside a transaction context, the JMS session being used to send or receive the message is automatically enlisted in the transaction through the XA capabilities of the JMS provider. This is the case whether the transaction was started implicitly because the JMS code was invoked inside an EJB with container-managed transactions enabled, or whether the transaction was started manually using the UserTransaction interface in a servlet or an EJB that supports bean-managed transactions.

  • JMS and XA Transaction

              Hy,
              I see that the JMS is integrated as XA Transaction directly from the container management
              on the Weblogic version 7.0.
              I test the same testcase on the Weblogic 6.0 but it didn't work automatically (the
              publish never commit).
              Starting from wich version of Weblogic the JMS-XA Transaction is integrated ?
              Thank you.
              Luigi
              

              Hy,
              I see that the JMS is integrated as XA Transaction directly from the container management
              on the Weblogic version 7.0.
              I test the same testcase on the Weblogic 6.0 but it didn't work automatically (the
              publish never commit).
              Starting from wich version of Weblogic the JMS-XA Transaction is integrated ?
              Thank you.
              Luigi
              

  • JMS to JDBC

    Hi Friends,
              This is Bhavya.Right now I am working with the interface i.e. JMS to JDBC.
    Can anybody send me the sample scenario?
    Thanks,
    Bhavya...

    Hi Bhavya,
    First you need to install the external drivers for JMS and JDBC adpater.
    You can check the following link for that.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bf4b1055-0d01-0010-32a3-b3848d77a6b9">How to Install and Configure External Drivers for JDBC JMS</a>
    Now your sender service is an JMS server, the details of which you must have..which you will provide it in the channel...it is not that complicated....
    For JDBC side..
    Check the following blog for the same.
    <a href="/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30">FILE to JDBC Adapter using SAP XI</a>
    <b>*Reward points if helpful*</b>
    Regards,
    Sushil

  • JMS and transactions

    Dear all,
    I need some clarification about JMS for my Thesis : after reading some tutorials I still am confused about JMS used with JTA transactions.
    1) If a JMS transacted session is started within a JTA transaction (let's say a UserTransaction spanned by an EJB) and the transaction rolls back, the message will be put back in the Queue, right ?
    2) Is it true also the opposite ? that is if I perform some insert/delete/update within a JMS transacted session, and the transaction is rolled back, the insert/delete/update are rolled back too ?
    Thank you very much for your help
    Lucas

    Hi Lucas,
    What you describe requires XA or distributed transactions. And (I'm fairly sure) XA doesn't work with Bean Managed Transactions and the UserTransaction interface. XA allows multiple transactional resources to get enlisted in a global transaction. When the app server decides all the work is done, the global transaction is committed or rolled back using a two-phase commit protocol.
    So except for the UserTransaction bit, what you describe is how it works. The messages will be only sent/received and the database work will only be committed if the whole global transaction is committed. If any part is rolled back, everything will be rolled back. JMS implementations typically will set the JMSRedelivered flag along with incrementing the JMSXDeliveryCount property when messages are put back on the destination.
    Dwayne
    =========================
    [http://dropboxmq.sourceforge.net/]

  • JMS and JTA

    We are getting two seperate transactions made , one JDBC (DB transaction , managed by WL container) and one JMS (Mq transaction). They are independent of each other. So if we send a message on a queue, an MQ transaction is started and ended and mesage gets send properly. But not if something wrong happens while processing, everything needs to be rolled back, including the MQ transaction. So idea is to have the MQ (JMS) transaction assoicated with the container managed JDBC transaction.
    I have seen some bok's and samples where it is possible to do this using bean managed transactions. But we are not using bean manged transactions. Is there any way to do this using container managed transactions ?

    Abhishek :
    Yes, this is possible.
    Have a container managed EJB call on the JDBC class and the MQ Sender class. Use a TxDataSource with a JTS driver for the JDBC operation. For the MQ send, you will need to enlist the MQ Series's XASessions' XAResource with the WL Transaction manager. You will need to go against an MQXAQueueConnectionFactory to achieve this.
    Thanks,
    Adarsh

  • Spatial Index and XA transaction

    Hi all,
    I have problem with spatial index in XA transaction.
    java.sql.SQLException: ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-29400: data cartridge error
    ORA-14450: attempt to access a transactional temp table already in use
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 623
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 227
    My configuration Java 5, Tomcat 5.5, UserTransaction manager Bitronix.
    The problem disappears after dropping spatial index.
    sql statement:
    INSERT INTO ICING_SPATIAL.MAP_ISSUES ( FEATURE_ID, GEOMETRY, AUTHOR_ID, ISSUE_ID, ISSUE_STATUS, LANGUAGE, SOURCE, TEXT) VALUES ( ? ,SDO_MIGRATE.TO_CURRENT( ? , ( SELECT DIMINFO FROM ALL_SDO_GEOM_METADATA WHERE OWNER = ? AND TABLE_NAME = ? AND COLUMN_NAME = ? ) ), ? , ? , ? , ? , ? , ? )
    Full stacktrace is:
    java.sql.SQLException: ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-29400: data cartridge error
    ORA-14450: attempt to access a transactional temp table already in use
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 623
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 227
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:212)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:951)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
    at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4245)
    All user transactions are commited or rollbacked because the DBA_2PC_PENDING is empty: SQL> select * from SYS.DBA_2PC_PENDING;
    no rows selected
    SQL>
    This problem occures regulary after any 2PC transaction has been rolledback. The next request causes this exception. Sometimes it appears after commit too, but I am able to reproduce it within ten or twenty requests.
    Has anybody had simillar problem?
    Thanks for any suggestions how to check what is going wrong.
    Regards,
    Zdenek Vrablik

    The problem is in Oracle Spatial.
    Oracle database don't support Temporary tables and XA transactions together. Oracle Spatial uses temporary tables.
    Possible solution (I am using)
    One database connection(nonXA) to read data and one connection(XA) to insedt/update/delete data including spatial data.

  • How to use DataSource and External transaction in 9ias?

    I'm working on a project that the application server needs to connect to over 100 databases.
    I'd like to use connection pooling and external transaction service defined in OC4J's Datasources.
    I wonder if anyone has an example of using datasource and external transaction service for OC4J.
    Right now, I export toplink project to a java source and do the initialization there manually but I don't know how to use Datasource to get connections and how to use the external transaction service in the java code for OC4J.
    I really appreciate you help.
    Wei

    Here is a fill in the blank example on how you could set this up through code:
    Project project = new MyProject();
    // alternatively, use the XMLProjectReader
    server = project.createServerSession();
    server.getLogin().useExternalConnectionPooling();
    server.getLogin().setConnector(new JNDIConnector(new javax.naming.InitialContext(), "jdbc/DataSourceName"));
    // the next line depends on the type of driver you want to use.
    server.getLogin().useOracleThinJDBCDriver();
    server.getLogin().useOracle();
    server.getLogin().setUserName("username");
    server.getLogin().setPassword("password");
    server.getLogin().useExternalTransactionController();
    server.setExternalTransactionController(new Oracle9iJTSExternalTransactionController());
    server.logMessages();
    server.login();

  • OSB JMS Proxy XA Transaction Rollback not occuring to queue

    Hi All
    We are dequeuing a message from JMS queue via an XA connection factory and then calling a web service. If any error occurs in the web service we catch the error handler, log and notify it and want to send this message back to the queue for retrial (The retry settings are defined at the Queue Level from weblogic console).
    Problem is rollback is not occurring, we have tried the below:
    1) There is no OSB reply with either success or failure in the error handler (This should have done the trick)
    2) We have also tried addiing an explicit Raise Error (Uncaught Error) to roll the message back, but its not working.
    This rollback is not occurring because JMS Resource is XA and web service call is NON XA, hence the entire message flow becomes NON XA. Is this understanding correct?
    How can we fix this? Please help

    Hi atheek1
    Thanks for the reply, it worked. Before I mark this question as answered, pls. answer the below queries (Thanks a lot!)
    1) Well, i just ticked transaction required and same transaction for response and it started working. I did not add routing options like you mentioned to QOS Exactly Once. Its working without it fine. So, my questions is what is the use of adding this QOS to exactly once. Is it mandatory?
    2) I have a couple of OSB services in which rollback is working automatically (XA JMS to JCA FTP Adapter) and (XA JMS to JCA DB adapter XA data source), here rollback works automatically. I dont have to tick transaction required. So my question is, when an XA based connection factory picks a message from the queue, a transaction is started at the container level. So why tick transaction required at the message flow level, when the weblogic has already initiated a transaction. Since you said that HTTP transport commits a transaction even if 500 or 404 occurs, it makes sense to tick is transaction required and same transaction for response in OSB proxy service. But the remaining scenarios work without these options. Hence will it be wise to say that these settings are only required for HTTP transport coz of the way it behaves (commits 404 and 500).
    Thanks

  • UserTransaction or JDBC transaction

    Hi,
    please give suggestions...
    We are using a application server with connection pooling
    jsp and servlets are used in project
    for transactions Is userTransaction is better or JDBC transaction is better
    userTransaction may be implemented like this
    try
    getUserTransaction
    transaction.begin
    execute queries
    transaction.commit
    catch()
    transaction.setRollbackOnly
    JDBC Transaction may be implemented like this
    connection.autoCommit=false
    try
    execute queries
    connection.commit
    catch()
    connection.rollback
    which is better for scalability and performance when we have to use transactins
    in jsp/servlets
    regards

    Hi,
    You are talking about using programmatic transactions in J2EE applications.
    When developing J2EE applications, you are recommended to use the transaction mechanism provided by the application servers.
    Sometimes, JDBC transaction can undertake the whole task. However, using JTA (Java Transaction APIs) is the better choice.
    Especially when you are going to develop a lot of components (JavaBeans/ EJBs).
    Imangine if a transaction is to be finished after the coroperation of serveral objects(JavaBean/ EJB instances).
    How can you control the begining and the ending of the transaction by puting codes in these programs?
    But it is very easy to input JTA codes (just like userTransaction etc.) to implement it.
    Therefore, to use JTA is more convinient.
    Additionally, J2EE specifications recommend to use declarative transactions in EJBs. Thus transaction management could be more flexible.
    Good luck.
    Gary Wang
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • Pros and Cons of using REST over JMS (and other technologies)

    Hey all,
    I am working on a project where we were using JMS initially to send messages between servers. Our front end servers have a RESTful API and use JEE6, with EJB 3.1 entity beans connected to a mysql database and so forth. The back end servers are more like "agents" so to speak.. we send some work for them to do, they do it. They are deployed in GlassFish 3.1 as well, but initially I was using JMS to listen to messages. I learned that JMS onMessage() is not threaded, so in order to facilitate handling of potentially hundreds of messages at once, I had to implement my own threading framework. Basically I used the Executor class. I could have used MDBs, but they are a lot more heavyweight than I needed, as the code within the onMessage was not using any of the container services.
    We ran into other issues, such as deploying our app in a distributed architecture in the cloud like EC2 was painful at best. Currently the cloud services we found don't support multi-cast so the nice "discover" feature for clustering JMS and other applications wasn't going to work. For some odd reason there seems to be little info on building out a scalable JEE application in the cloud. Even the EC2 techs, and RackSpace and two others had nobody that understood how to do it.
    So in light of this, plus the data we were sending via JMS was a number of different types that had to all be together in a group to be processed.. I started looking at using REST. Java/Jersey (JAX-RS) is so easy to implement and has thus far had wide industry adoption. The fact that our API is already using it on the front end meant I could re-use some of the representations on the back end servers, while a few had to be modified as our public API was not quite needed in full on the back end. Replacing JMS took about a day or so to put the "onmessage" handler into a REST form on the back end servers. Being able to submit an object (via JAXB) from the front servers to the back servers was much nicer to work with than building up a MapMessage object full of Map objects to contain the variety of data elements we needed to send as a group to our back end servers. Since it goes as XML, I am looking at using gzip as well, which should compress it by about 90% or so, making it use much less bandwidth and thus be faster. I don't know how JMS handles large messages. We were using HornetQ server and client.
    So I am curious what anyone thinks.. especially anyone that is knowledgeable with JMS and may understand REST as well. What benefits do we lose out on via JMS. Mind you, we were using a single queue and not broadcasting messages.. we wanted to make sure that one and only one end server got the message and handled it.
    Thanks..look forward to anyone's thoughts on this.

    851827 wrote:
    Thank you for the reply. One of the main reasons to switch to REST was JMS is strongly tied to Java. While I believe it can work with other message brokers that other platforms/languages can also use, we didn't want to spend more time researching all those paths. REST is very simple, works very well and is easy to implement in almost any language and platform. Our architecture is basically a front end rest API consumed by clients, and the back end servers are more like worker threads. We apply a set of rules, validations, and such on the front end, then send the work to be done to the back end. We could do it all in one server tier, but we also want to allow other 3rd parties to implement the "worker" server pieces in their own domains with their own language/platform of choice. Now, with this model, they simply provide a URL to send some REST calls to, and send some REST calls back to our servers.well, this sounds like this would be one of those requirements which might make jms not a good fit. as ejp mentioned, message brokers usually have bindings in multiple languages, so jms does not necessarily restrict you from using other languages/platforms as the worker nodes. using a REST based api certainly makes that more simple, though.
    As for load balancing, I am not entirely sure how glassfish or JBoss does it. Last time I did anything with scaling, it involved load balancers in front of servers that were session/cookie aware for stateful needs, and could round robin or based on some load factor on each server send requests to appropriate servers in a cluster. If you're saying that JBoss and/or GlassFish no longer need that.. then how is it done? I read up on HornetQ where a request sent to one ip/hornetq server could "discover" other servers in a cluster and balance the load by sending requests to other hornetq servers. I assume this is how the JEE containers are now doing it? The problem with that to me is.. you have one server that is loaded with all incoming traffic and then has to resend it on to other servers in the cluster. With enough load, it seems that the glassfish or jboss server become a load balancer and not doing what they were designed to do.. be a JEE container. I don't recall now if load balancing is in the spec or not..I would think it would not be required to be part of a container though, including session replication and such? Is that part of the spec now?you are confusing many different types of scaling. different layers of the jee stack scale in different ways. you usually scale/load balance at the web layer by putting a load balancer in front of your servers. at the ejb layer, however, you don't necessarily need that. in jboss, the client-side stub for invoking remote ejbs in a cluster will actually include the addresses for all the boxes and do some sort of work distribution itself. so, no given ejb server would be receiving all the incoming load. for jms, again, there are various points of work to consider. you have the message broker itself which is scaled/load balanced in whatever fashion it supports (don't know many details on actual message broker impls). but, for the mdbs themselves, each jee server is pretty independent. each jee server in the cluster will start a pool of mdbs and setup a connection to the relevant queue. then, the incoming messages will be distributed to the various servers and mdbs accordingly. again, no single box will be more loaded than any other.
    load balancing/clustering is not part of the jee "spec", but it is one of the many features that a decent jee server will handle for you. the point of jee was to specify patterns for doing work which, if followed, allow the app server to do all the "hard" parts. some of those features are required (transactions, authentication, etc), and some of those features are not (clustering, load-balancing, other robustness features).
    I still would think dedicated load balancers, whether physical hardware or virtual software running in a cloud/VM setup would be a better solution for handling load to different tiers?like i said, that depends on the tier. makes sense in some situations, not others. (for one thing, load-balancers tend to be http based, so they don't work so well for non-http protocols.)

  • Mix Local and Global Transaction using XA Driver for Oracle

    Hi all,
    We are trying to use a XA Driver which can support both local as well as global
    transaction. We tried using the Weblogic jDriver (XA Driver) type 2 that comes
    along with Weblogic installation but unfortunaltely it cannot mix local as well
    as global transaction.
    Please let me know in case we have any XA JDBC driver for Oracle Database which
    supports both local and global transaction together.
    Thnx,
    Kumar
    Environment:
    Weblogic 8.1 server
    Database used : Oracle8i

    Most database drivers can support local and global transactions, with some
    restrictions.
    The JDBC spec has been changed to require compliant drivers to let the
    application
    know if they try to start a global transaction while a local transaction has
    not been
    completed (or vice verse). So most of the database drivers have been
    changed to enforce
    this restriction (breaking a lot of code that is out there).
    "Kumar Raman" <[email protected]> wrote in message
    news:4033457c$[email protected]..
    >
    Hi all,
    We are trying to use a XA Driver which can support both local as well asglobal
    transaction. We tried using the Weblogic jDriver (XA Driver) type 2 thatcomes
    along with Weblogic installation but unfortunaltely it cannot mix local aswell
    as global transaction.
    Please let me know in case we have any XA JDBC driver for Oracle Databasewhich
    supports both local and global transaction together.
    Thnx,
    Kumar
    Environment:
    Weblogic 8.1 server
    Database used : Oracle8i

  • A jdbc transaction error occur

    Hi Everybody
    A jdbc transaction error occur when I deploy the application on the server .
    Below is the stack trace
    #SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot commit transaction from this connection of "YTSQLS2K" DataSource. This resource participates in a local or distributed transaction.
    #SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot initiate transaction from a connection of "YTSQLS2K" DataSource. Local or distributed transaction has already started.
    #SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot commit transaction from this connection of "YTSQLS2K" DataSource. This resource participates in a local or distributed transaction.
    Any idea about it
    I use the jdbc version in datasource <jdbc-1.x>
    is there a need to replace it with <jdbc-2.0>
    Thank You
    Syed Saifuddin

    Hibernate allows you to choose transaction manager. As Nikolay pointed out, in a JEE envirnment it's prefferable to use JTA transactions. All you need to do is to configure hibernate to use a JTA transaction manager. It is all written in the Hibernate documentations. See
    http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-j2ee
    and
    http://www.hibernate.org/42.html#A5 .
    The relevant properties that need to be set in the configuration are:
    hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
    and
    hibernate.transaction.manager_lookup_class=<Class that knows how to lookup>
    You need to implement a class that knows how to lookup user transaction in SAP J2EE Egnine.
    The class must extend org.hibernate.transaction.JNDITransactionManagerLookup and only override its abstract method getName (simply returning the lookup string). Then provide the fully qualified name as value of the property and make sure that Hibernate can load the class.
    That should work.
    HTH
    -Georgi
    Message was edited by:
            Georgi Pavlov

Maybe you are looking for

  • Polygon2D.Float

    I created this Polygon class. I've already tested it and it works just like java.awt.Polygon. This class supports floating point coordinates. It does not extend Polygon in java.awt. Enjoy import java.awt.*; import java.awt.geom.*; * This is a polygon

  • HT201210 iphone displays "itunes" logo with a USB cable pointing toward it

    Hi Whilst downloading the latest "itunes" update, I left the room and came back half an hour later to discover the above on my iphone screen. On switching the phone off to remove the symbol message, the same message on a black background was all I co

  • Does ''Node'' work with my G4?

    I've got a G5 dual 2,7. And to sell my (like new) G4 867 is just a waste of money. I rather keep it. So I am asking myself if I can use that one together with my G5 with that ''node-function'' of Logic 7.2, if I ever need more CPU-Power? And if yes:

  • Two boards in one system (Onboard SoundMax + Live 5.1 digital), how

    Hi All, i am trying to make a Sound Blaster Li've 5. digital coexist with a Onboard SoundMAX, but when i put the Li've 5. to work, it makes the system to ignote the presence of the SoundMAX, and the curious is that the Li've 5. reports itself as work

  • Batch processing Impulse Responses

    Well guys and gals, the title says it all! I have plenty of impulse responses and would like to import them into Space Designer... but not one by one. Is there any way to batch-process them to make my life a bit easier? Maybe a command line? Thanks!