Multiple Database access in a single transaction

Hello All,
I have read in a book which states that "according to J2ee Specification,a single transaction(an EJB method for example) may not be provided access to multiple JDBC resource providers.."
Does it mean that i cannot access multiple databases from different vendors in a single EJB transaction??
Any help is very much appreciated
Thanks

Hello Sebastien,
Thanks for your response!!!
Let me make it bit more clear.In deploymewnt descriptor,we define jndi name for any resource and do a lookup on that resource from the code.
Let us consider that resource as JDBC data source for our discussion.usually you define any jdbc data source under a JDBC resource provider.
So my question is,in a single transaction can you access multiple data sources defines under multiple JDBC resource providers.
Ex:A datasource "x "defined under resource provider "A"[say DB2 jbdc provider] and a datasource "y" defined under respurce provider "B"[say mysql jdbc provider].
Thanks

Similar Messages

  • Multiple DataBase Connection in a Single Form

    hi all
    Is it Possible to have Multiple Database Connection With a Single Form
    Block a : Retriving data from a database Service a/Schema A.
    Block b : Retriving data from a Remote Database Service b / Schema B.
    If yes how to do this.
    regards
    jai
    email:[email protected]

    Sure you can access a database this way,
    but can you base a block on this database connect? No you can't.
    Frank

  • Entering multiple scrap accounts in a single transaction

    Hi guys
    Can I enter multiple scrap accounts in OSFM transactions in a single form?
    I hope oracle offers only single a/c for each step.
    This will minimize the data entry effort for me.
    Please suggest any work arounds.
    Regards
    Sreee

    Hello Sebastien,
    Thanks for your response!!!
    Let me make it bit more clear.In deploymewnt descriptor,we define jndi name for any resource and do a lookup on that resource from the code.
    Let us consider that resource as JDBC data source for our discussion.usually you define any jdbc data source under a JDBC resource provider.
    So my question is,in a single transaction can you access multiple data sources defines under multiple JDBC resource providers.
    Ex:A datasource "x "defined under resource provider "A"[say DB2 jbdc provider] and a datasource "y" defined under respurce provider "B"[say mysql jdbc provider].
    Thanks

  • Multiple database members in a single Grid Row

    Hi All,
    I have created an FR report (9.3x) and getting the below error while trying to run the report via Web Preview.
    5217: Error Processing Results;hasPovDims=1;povXML=<?xml version="1.0"?><datasources><datasource name="FIN QA" dsid="-117fcde3_132fd17f2f6_-771b" allowEdit="1"><dim name="Versions" dimIndex="0" dsName="FIN QA" keyDimName="Versions" memberName="Versions" displayName="Versions: Versions"/><dim name="Scenarios" dimIndex="4" dsName="FIN QA" keyDimName="Scenarios" memberName="Scenarios" displayName="Scenarios: Scenarios"/><dim name="Components" dimIndex="5" dsName="FIN QA" keyDimName="Components" memberName="Components" displayName="Components: Components"/><dim name="Customers" dimIndex="6" dsName="FIN QA" keyDimName="Customers" memberName="Customers" displayName="Customers: Customers"/><dim name="Assets" dimIndex="7" dsName="FIN QA" keyDimName="Assets" memberName="Assets" displayName="Assets: Assets"/></datasource><datasource name="FINDEF QA" dsid="-607fb334_128b79d246e_-7d0a" allowEdit="1"><dim name="Time Periods" dimIndex="1" dsName="FINDEF QA" keyDimName="Time Periods" memberName="Time Periods" displayName="Time Periods: Time Periods"/><dim name="Scenario" dimIndex="3" dsName="FINDEF QA" keyDimName="Scenario" memberName="SC_Actual" displayName="Scenario: SC_Actual"/><dim name="Versions" dimIndex="4" dsName="FINDEF QA" keyDimName="Versions" memberName="VR_Input_Version" displayName="Versions: VR_Input_Version"/><dim name="Customers_Region" dimIndex="6" dsName="FINDEF QA" keyDimName="Customers_Region" memberName="CU_NA" displayName="Customers_Region: CU_NA"/><dim name="Assets" dimIndex="7" dsName="FINDEF QA" keyDimName="Assets" memberName="Assets_NA" displayName="Assets: Assets_NA"/></datasource></datasources>
    In my report I have selected 2 rows where I have selected @descendants of ccounts from one database which is FIN QA and in the second row I have selected @children of Accounts from another database which is FINDEF QA. I am using only ONE GRID here.
    Is it not possibe to run a FR report by select members from multiple databases in a single grid??
    Please have your valuable inputs.

    Yes it possible to retrive data from multiple database using single grid.
    Also there are few limitations namely:
    Database connections must be of the same type (for example, both must be Essbase database connections or both must be Financial Management database connections).
    Mismatched number of dimensions in the database connections may cause retrieval errors.
    For more details refer to this link for details:-
    http://www.oracle.com/technetwork/middleware/financial-management/tutorials/obe-multipledbs-086586.html
    Cheers
    Vikas Naidu

  • Need to get data from multiple database instances in a single query

    Hi,
    I need a small favour from you guys. The prob is as follows:
    I need to get name, row_id from table A from schema 1 and gbu_name, name from table B from schema 2 where a.name = b.name. I wrote the query in the following manner:
    SELECT a.name, a.row_id, b.gbu_name
    FROM Schema1.A as a, Schema2.B as b
    Where a.name = b.name
    But this query is not working and the error is like " The table does not exists".
    Please update me how to avoid the error and get the right sort of result.
    Thanks & Regards,
    Debabrata

    Ah, youre actually asking different things.
    In your topic title, you say youre running separate instances
    In your body text, you say you are under different user/schema
    So tell me, do you have more than one database or not? How many entries in your TNS file?
    I would say, for "multiple database instances"
    SELECT
      a.id, b.id
    FROM
      tableA a
      INNER JOIN
      tableB@OTHER_DATABASE_LINK_NAME b  <--NOTE!
      USING(id)And of course you will have to look up CREATE PUBLIC DATABASE LINK sql..
    Message was edited by:
    charred

  • Multiple database access

    Hi there!
    I'm having problems with connection to my databases. The idea is:
    -step 1. Check if a number exists in database A (connect A-->query-->close A)
    -if the number does exist, do nothing
    -step 2 else, open database B and,
    -step 3 copy the record of the particular number to database A (connect B-->query-->close B --> connect A --> query --> close A)
    Now the problem is that somehow the database url stays the same (URL of db A), and so I cannot connect to database B.
    This is my db connection method, which I call from another class. As you can see, i've put up some println's to see where the error pop's up, but it makes absolutely no sense.
    public void openConnection(String database, String username, String password)
                   try     {
                        String url = new String("jdbc:mysql://" + database);
                        Class.forName("com.mysql.jdbc.Driver");
                        System.out.println("Opening database "+url +" with credentials: "+username+ " AND password: "+password);
                        connection = DriverManager.getConnection(url, username, password);
                        System.out.println("Connection opened");
                   } catch( ClassNotFoundException e) {
                   System.out.println("JDBC Error:");
                   e.printStackTrace();
                   catch ( java.sql.SQLException e ) {
                   System.err.println("SQL Exception:");
                   e.printStackTrace();
         }Now the following output/error occurs:
    (step 1)Opening database jdbc:mysql://localhost/sms with credentials: blaat AND password: blaat
    Connection opened(step 2)Opening database jdbc:mysql://otherhost/users with credentials: blaat1 AND password: blaat1
    SQL Exception:
    java.sql.SQLException: Access denied for user 'blaat1'@'localhost' (using password: YES)(step 3)Opening database jdbc:mysql://localhost/sms with credentials: blaat AND password: blaat
    Connection openedAnyone?!

    JKNOWS wrote:
    Then I call openconnection with database address "otherhost" (which it DOES display in the System.out.prinln) but the connection fails, and when you look in the errorlog you can see that it still tried to connect to "localhost"..?!??!As a guess you are reading more into that error message that what it says.
    The error can only occur if it is in fact connecting to a database. So at a minimum if you stopped the local server then you can insure that it is not doing that. But as a guess I would suppose 'localhost' in the error message is meaningless. As noted in the previous post it is just telling you that the log in failed.

  • How to handle multiple database tables in a single UIX page?

    Hi,
    I am new to UIX & BC4J. I have to handle data from four different tables in the database. The scenario is as follows:
    The tables are
    1. user
    fields are: userid number, name varchar2
    2. business
    fields are: businessId number, name varchar2
    3. service
    fields are: serviceId number, serviceName varchar2
    4. userBusiness
    userid,businessid (both are foreign keys) & form complex primary keys.
    and userid,businessid, serviceId are primary keys.
    Now my problem is: to create a webpage where
    1. The userid is available in the httpSession Variable as string.
    2. according to the userId stored in the session variable I have to retrieve the business names and show them in a choice i.e., pull down box.
    3. I have to show the services provided by the business for the business name selected in the combo box.
    Could anyone Please help me solve this problem? Could you please give me hints? I have truncated the other fields in the tables.
    Thanking you,
    Velpandian .S

    At the moment, you can't do it declaratively. You have to do it in an event handler. Assuming you have the userid setup as a query parameter in the view object, something like this should get you started:
    public EventResult handleEvent(
    BajaContext context, Page page, PageEvent event) throws Throwable
    HttpSession session = context.getServletRequest().getSession(true);
    ViewObject view = ServletBindingUtils.getViewObject(context);
    String userid = session.getAttribute("userid");
    view.setWhereClauseParam(0, userid);
    view.executeQuery();

  • Multiple database fields in a single text field

    hii all
    i am trying to do the follwing
    i have in my database city ,state adn zip
    I want to display them in one field of my tablular form ie the field will have a prompt
    prompt :- City ,State and Zip
    and in the field i will have the corresponding database values for the 3 seperated by commas
    how can i do it ??
    plzz help
    mandar

    Hello,
    Create a non-based item, then populate it with concat in a POST-QUERY trigger.
    Francois

  • Multiple databases in one single RAC cluster

    Hi, I would like to know if one can have multiple databases running on a single RAC cluster, we have several databases in our shop and would like to consolidate all of them into a single 3-4 node RAC cluster running databases with 10.2 and 11.1 versions.
    I am newbie to RAC and would like to get some clarification if anyone has done this, google search comes up with few hits on this topic, so obviously this is not doable.
    In our case we have one database supporting critical applications and few other not so critical but are used very extensively between 9-5, so what is the use of RAC if I cannot consolidate all my databases into one cluster, or if I need a separate cluster for each of these critical databases?
    I have been all the Oracle docs that keep repeating one database multiple instances and one instance-one machine-one node, they don't even advise running multiple instances on a single node?.
    I appreciate any insight.
    Thanks.

    ora-sql-dba wrote:
    Can you give more details on how you would setup multiple databases running different versions on a single RAC cluster, I am yet to find any documentation that supports or even elaborates on this topic.You can configure a cluster with 12 nodes. Then, using dbca, configure a dev instance for nodes 1 and 2, a prod1 instance for nodes 3 to 6 and a prod2 instance for nodes 7 to 12.
    You also can configure each of these instances for all 12 nodes. And use it on all 12 nodes.
    Or, after configuring it for all 12 nodes, you can start the dev instance on nodes 1 and 2, prod1 on 3 - 6 and prod2 on the remaining nodes. If dev needs more power, you can for example shutdown prod2 on node 12 and start another dev instance there.
    My issue is with the 2nd option - running more than one instance on the same node or server. Why? Each instance has a basic resource footprint ito shared memory needed, system processes required (like db writer, log writer, sys monitor) etc. It does not make sense to pay for that same footprint more than once on a server. Each time you do, you need to reduce the amount of resources that can be used by each instance.
    So instead of using (for example) 60% of that server's memory as the SGA for a single instance, if you use 2 instances on that server you now have to reduce the SGA of each to 30% of system memory. Effectively crippling those instances by 50% - they will now have smaller buffer caches, require more physical I/O and be more limited in what they can do.
    So unless you have very sound technical reasons for running more than one instance on a server (RAC or non-RAC), do not.

  • Multiple database Updates in wls6.1 how to do it?

    Hi,
    I need to use more than 2 databases (DB1 on SQL server /DB2 on Oracle), which have to be accessed in a single transaction.
    I have the following configuration JDK1.3 and BEA WLS 6.1.
    i saw some where in the discussion forum that this can be done in 6.1 but was unable to find how to do it, Anybody knows how to do it, can u please lemme know!
    Thank you,
    Diwakar.K

    Hi, you must use JDBC XA drivers in your pools.
    Sergi
    Diwakar Kamisetti <[email protected]> wrote:
    Hi,
    I need to use more than 2 databases (DB1 on SQL server /DB2 on Oracle),
    which have to be accessed in a single transaction.
    I have the following configuration JDK1.3 and BEA WLS 6.1.
    i saw some where in the discussion forum that this can be done in 6.1 but
    was unable to find how to do it, Anybody knows how to do it, can u please
    lemme know!
    Thank you,
    Diwakar.K

  • Discoverer Reporting Solution for Multiple Databases

    I have to build oracle discoverer reports (single point of access) for four different applications. Each application is having separate databases. So whether i should create separate EULs for each applications (in respective databases) or Should i create a single EUL in any one of the databases and then use db links to connect rermaining databases (for reports from the other applications).
    Can u suggest me which method will work good if you see the performace?. I need a dingle point of access for all the discoverer reports.
    The worksheets need to be deployed with oracle portal for access of reports in a single click. Is there any way to pre configure the db credentila for each worksheet...?

    Hi
    My replies below make the assumption that you are not allowed to do any ETL and therefore the data from each database has to be pulled as is. If you do have ETL capability the situation changes dramatically.
    In addition to what Sharon has said the cost based optimiizer will have a difficult job rewriting your query efficiently if you use database links, and if you attempt to have queries with some tables from one database and some from another the optimizer will not work at all. I mean. How could it? How could the optimzier in database A know anything about the statistics in databases B, C or D? Wherever the EUL is, that is where the driving optimizer will be so choose wisely obi-wan :-)
    For me it's more about user needs than IT needs. If the business has a need to combine data from multiple databases then having a single EUL with database links would be a necessity. However, if they really are disparate systems with nothing in common such as say having Peoplesoft HR in one and E-Busines Suite Inventory in another with perhaps an in-house tracking system in another then I would look at having separate EULs, one in each.
    Having one EUL across non-related systems means you have to mix users and roles and can be hard to manage. It actually becomes messy when just two databases are involved never mind four. So even though you might think it is more difficult to maintain 4 EULs, if the objects really are different and you have differing roles and usernames it actually will probably be simpler. They will be simpler to backup, simpler for exporting and importing and it will be faster for Discoverer to maintain workbooks as there will be fewer of them. Plus your system will have access to its local optimzier thereby ensuring the SQL is efficient.
    If you are going to use one EUL you need to start out on a sound foundation. This means using libraries to control access too business areas and workbooks. You'll need to adopt some simple naming standards to keep things separate and manageable. I wrote a paper about libraries a few years ago and it is available free of change here on my website: http://ascbi.com/downloads.htm. The paper is called Discoverer Libraries - a Concept.
    Best wiishes
    Michael

  • How to display mutliple rows of database data in a single row

    We are using XML Publisher 5.6.2. We have a requirement, where we need to display a multiple database rows for a single column in a single row.
    Basically say a database column has 5 rows
    A1
    A2
    A3
    A4
    A5
    We want to display in the output in a single cell as
    A1 A2 A3 A4 A5
    Thanks,
    - Vasu -

    Look at this blog,
    http://blogs.oracle.com/xmlpublisher/2007/05/24#a325

  • Contact Two Datasources in Weblogic 10 in a single transaction

    Hi,
    my requirement is to create two datasource which points to two different schemas of oracle 10 g database.
    In a single transaction i may be in requireemnt of contacting both the datasource to get respective db connection and do a insert/update.
    I created two datasources A and B which use Oracle 9 thin driver.
    When my application starts my app is able to get connection of datasource A and unable to get connection on datasource B. what may be the problem ??
    both uses Oracle non-XA driver with one phase commit;
    Let me know how to connect to two diff datasources in a single transaction.
    Thanks in Advance.
    Sreehari.

    Do you get like any error for second datasource like jndi lookup failed or exactly what do you see error. If I understand your usecase:
    DataSource_1 -> Uses ConnectionPool_1 -> DB Schema_1
    DataSource_2 -> Uses ConnectionPool_2 -> DB Schema_2.
    So in your java application, I guess you are using JNDI Lookup and pass above Datasources unique JNDI names, and get 2 instances. I mean you have like 2 sets of Jndi lookup code to get 2 connection objects. This looks pretty straight forward. Does not matter what drivers you use.
    Are you reusing any objects in your code, like have a single connection object and then close it and try to recycle it for second something like that...If not, check for any errors in the log files.
    Ravi Jegga

  • Using Single Datasource to Access Multiple Databases

    Hi,
    We would like to know the pros and cons of accessing multiple
    databases through a single datasource, versus accessing each
    database through its own datasource. Our environment includes
    multiple web servers w/ the latest version of ColdFusion MX 7,
    clustered through a load balancer. Each web server has 800+ dsns
    pointing to different SQL databases on the same SQL server. We have
    noticed that the ColdFusion administrator is taking a long time to
    display or verify all datasources and sometimes it even times out.
    Another problem is that sometimes the neo-query file gets corrupted
    (for unknown reasons) which results in the deletion of one, or
    more, or all datasources on the web server.
    Because of the issues above we are researching the
    possibility of removing most of the datasources, and then accessing
    each database through a single bridge datasource. In that regard we
    plan to change our queries by inserting the sql db name and user in
    front of each table in the query such as:
    <cfquery name="query" datasource="single_dsn_name">
    select * from [#dbname#].dbo.tableName
    </cfquery>
    In the example above, obviously #dbname# would be a variable
    that will hold the name of the requested database. The code above
    would similarly apply to queries using, update, insert and join
    words.
    Are there any limitations or negatives from scalability,
    performance, and reliability perspective in implementing the above
    scenario versus having one datasource for each database.
    Also, if there is a better way of accomplishing this, we
    would love to hear about it.

    Here is my opinion, because I work with both schemas. The
    main advantage to use one datasource for all DBs in a SQL Server is
    the simplicity of administration.
    But the main disadvantage is security, because you are using
    a single user to access all DB in a server, you don't have
    isolation, and a user that knows your schema can access data of
    other DBs that he sould not be authorized.
    Another issue is is a user must access 2 differents DB with
    different permissions (a DB only read and the other read/write),
    you'll have to create another datasource, user, etc for it.
    But the decision depends in the enviroment. If you are a
    hosting company, I would use 1 datasource for user or DB. If the
    servers and DBs are of the same company, I could use one datasource
    for each SQL server.
    Best regards

  • How to access multiple database present in single instance

    Hi Team,
    In oracle 11.2, can there be multiple databases in an instance???  In one of our environment, I could see multiple databases in an instance. Could you please help me in giving the data dictionary or query to access those databases?
    Actually, querying v$database, I could see only one database which is same as instance name. But in inventory, there are multiple database in an instance?
    I am still not exactly clear about this. Can someone help me with this?
    Thanks!
    Vidhya

    In Oracle one instance manages one (1) database. A database consists of multiple *schemas*.
    Other vendors erroneously call a schema 'database'.
    So, no, you didn't see multiple databases.
    There is also one datadictionary, consisting of a set of views.
    All views beginning with dba_  list the entire database, all schemas.
    All views beginning with all_ list the objects you have access to.
    All views beginning with user_ list your own objects.
    The view DICT show you the contents of the datadictionary.
    Oracle also has online documentation at http://docs.oracle.com
    From your question it is clear you should read the document called the 'Oracle Concepts Manual'.
    You can find all documentation for 11gR2 here Oracle Database Online Documentation 11g Release 2 (11.2)
    Too many people here don't make any effort to read it. This is probably the reason why you got no response.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for