ODI database connection - session question

Hi,
I have a package, where I have used a procedure.
In my procedure, I open a database connection.
My question is - In my next procedure - will I be able to use my same database connection which I created in previous step?
Re-phrasing the question - for any number of database transaction happening in a package, will ODI opens multiple database connection per step or will there be only one single database connection?
Thank you,
Paras

I believe its one per session so one connection inside the package. I think you should be , although i have not tried it practically.

Similar Messages

  • Monitor database connections/sessions

    Hi, i would know if anyone has suggestion on how i can monitor the number of connections to the db from a particular host?
    From the oracle client's oracle enterprise manager console, i can go network->database->instance->sessions, i can see the which remote host is the connection coming from and what program is using the connection.
    From the OS level i could do a primitive `ps -ef | grep ORACLE_SID ` to see and count the total number of connections.( but i cant see which remote is the connection coming from)
    I would like to achieve the purpose of remotely monitoring of the DB, if there are too many sessions coming from a particular host, running a particular program, send out alerts.
    Are there any oracle commands or OS scripting that i can use?

    Potentially, you could query the v$session data dictionary to get this sort of information for active connections. You might also want to audit connections and query the audit tables.
    Of course, unless you're trying to monitor a problem that is very particular to your environment, I'm not sure how useful the sort of monitoring you're proposing would be. Knowing that there are a larger number of connections from a particular host than normal wouldn't seem to be a particularly interesting event.
    Justin

  • Database Connection design question

    Hello, I have a design question. Awhile back I needed to create a database connection to SQL Server, so I created a class to do it
    import java.sql.*;
    import java.io.*;
    import java.net.MalformedURLException;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    public class SQLServerConnection
         private static Connection connection = null;
         public SQLServerConnection(String user, String password, String dbName) throws java.sql.SQLException
              getDBConnection(user, password, dbName);
         public SQLServerConnection(String configFileName) throws java.sql.SQLException
              getDBConnection(configFileName);
         private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
             DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
             connection = DriverManager.getConnection(
                  "jdbc:microsoft:sqlserver:" + dbName, user, password);              
         private void getDBConnection(String configFileName) throws java.sql.SQLException
              String user;
              String password;
              String dbName;
              try
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = factory.newDocumentBuilder();
                   Document doc = db.parse(configFileName);
                   doc.getDocumentElement().normalize();
                   // get the configuration information
                   password = getConfigParameter("password", doc);
                   user = getConfigParameter("username", doc);
                   dbName = getConfigParameter("databasename", doc);
                   getDBConnection(user, password, dbName);
              catch (MalformedURLException murle)
                   System.out.println("Unable to connect to: " + configFileName + " -- " + murle);
                   System.exit(1);
              catch (FileNotFoundException fnfe)
                   System.out.println("Configuration file " + configFileName + " not found.");
                   System.exit(1);
              catch (IOException ioe)
                   System.out.println("IOException: " + ioe);
                   System.exit(1);
              catch (javax.xml.parsers.ParserConfigurationException pce)
                   System.out.println ("Parser Configuration Error: " + pce);
              catch (SAXException saxe)
                   System.out.println ("SAXException: " + saxe);
         private String getConfigParameter(String paramName, org.w3c.dom.Document doc)
              NodeList nl = doc.getElementsByTagName(paramName);
              if(nl != null)
                   Node n = null;
                   for (int i = 0; i < nl.getLength(); i++)
                        n = nl.item(i);          
                        if(n.hasChildNodes())
                             NodeList children = n.getChildNodes();
                             return ((Node)children.item(0)).getNodeValue();
              else
                   System.out.println ("nl is null");
              return "";          
         public void setCatalog(String catalogName) throws java.sql.SQLException
              connection.setCatalog(catalogName);
         public Connection getConnection()
              return connection;
         public void closeConnection()
              try
                   connection.close();
              catch(java.sql.SQLException sqle)
                   System.err.println ("SQL Server Connection failed to close: " + sqle);
    }Later on, I needed to do the same thing for MySQL, so I created a class for that, MySQLServerConnection which is exactly the same as above, except for:
    private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
              try
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
                   connection = DriverManager.getConnection(dbName, user, password);     
              catch(java.lang.ClassNotFoundException cnfe)
                   System.out.println (cnfe);
              catch(java.lang.InstantiationException ie)
                   System.out.println (ie);
              catch(java.lang.IllegalAccessException iae)
                   System.out.println (iae);
         }Later, on, I did the same thing with OracleServerConnection. My question is, I know this is probably not optimal code. For example, I didn't originally have a close connection method, so I had to go in and code one for all 3. I'm assuming that an interface would be a good idea so that if I have to code another database connection class I make sure and include all of the appropriate methods. I'm also assuming that it would have been smart to have a master class, maybe something like DatabaseConnection and extended these classes from that. Am I on the right track? Totally offbase?

    @nclow - I will work on trying the Factory Pattern for this over the weekend and post when I finish to see what you think.
    @abillconsl - just to make sure I understand, you're saying that I just try to connect and it will cycle through the different database connection possibilities and connect when it finds the right one? If it fails all 3, log an appropriate message. One question I have about this is, I thought I was being object oriented by separating the different types of db connections (Oracle, SQL Server, MySql) into different classes. Am I missing the point of OOP by what I was/am trying to accomplish? Going overboard? Also, does your way try and connect to all 3 even if I connected to one already?
    Thx, Grantarchy
    Edited by: grantarchy on May 9, 2008 9:50 PM

  • General Design With Database and Session Bean Question

    I have an application I am developing where users connect to individual databases located on a server. When they login an admin table is accessed which shows what databases they have permissions to. I am then storing the connection to the database in a backing bean. Hoping to use this connection throughout the session. Is this a good practice to have a users connection left open over the session? I can't create a database pool for each individual database and each user for that database.
    If I can store that database connection in a session bean. How do I access that connection from another bean. Or from another java class? I am using Glassfish for my application server with JSF1.2. I have looked at resource injection but have not had any luck with sharing the session bean information.
    Sorry if this is a trivial question. I have been a Java developer for years. But just starting developing webapps using JSF.
    Thanks

    JuCobb2 wrote:
    I am then storing the connection to the database in a backing bean. Hoping to use this connection throughout the session. Is this a good practice to have a users connection left open over the session? No it is not. Why should you do so? Always keep the lifetime of connection, statement and resultset as short as possible.

  • Session scope/Database connection

    Hi y'all!
    I got some questions about session scope and database connections:
    I'm using a bean called dataBase. With this bean i open a database connection and execute some sql statements. the bean has page-scope, which means, as far as i know, the bean will be destroyed after the user leaves the current page.
    but what happens with my dataBase connection?!? could it be possible that it is still active after the bean was destroyed? so should i close my database connection manually or will it close automatically when the bean is beeing destroyed?
    thanks for your help!

    You should explicitly close the connection. One way is to use the finally clause to ensure that the connection is closed even if your code throws an exception.

  • Design question for database connection in multithreaded socket-server

    Dear community,
    I am programming a multithreaded socket server. The server creates a new thread for each connection.
    The threads and several objects witch are instanced by each thread have to access database-connectivity. Therefore I implemented factory class which administer database connection in a pool. At this point I have a design question.
    How should I access the connections from the threads? There are two options:
    a) Should I implement in my server class a new method like "getDatabaseConnection" which calls the factory class and returns a pooled connection to the database? In this case each object has to know the server-object and have to call this method in order to get a database connection. That could become very complex as I have to safe a instance of the server object in each object ...
    b) Should I develop a static method in my factory class so that each thread could get a database connection by calling the static method of the factory?
    Thank you very much for your answer!
    Kind regards,
    Dak
    Message was edited by:
    dakger

    So your suggestion is to use a static method from a
    central class. But those static-methods are not realy
    object oriented, are they?There's only one static method, and that's getInstance
    If I use singleton pattern, I only create one
    instance of the database pooling class in order to
    cionfigure it (driver, access data to database and so
    on). The threads use than a static method of this
    class to get database connection?They use a static method to get the pool instance, getConnection is not static.
    Kaj

  • Database connection pooling in ADF causing db procedure calls to use different transaction or session

    We have developed an application using JDev Version 11.1.2.1.0 and the database is oracle 11g EE.
    We have many database procedures or function calls from the model (AMImpl.java, VORowImpl.java) and the commit does not happen in the database and it happens from ADF. The database procedures are called in some valueChangeListnener and these procedures use the same transaction or session database session when called and update some records in some tables that are displayed in pages.
    We started using connection pooling recently in our ADF application,  -Djbo.doconnectionpooling=true -Djbo.txn.disconnect_level=1. When using connection pooling, we noticed that the database procedure calls use a different trasanction or different database session and the data or records that these procedures update is lost.
    After removing the connection pooling, we noticed that the procedures again started using the same transaction or same database session and was working fine.
    I want to know why this connnection pooling caused this issue and is there any fix for this when using connection pooling?

    Take a look at
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#CIHCHHEA
    What You May Need to Know About Database User State and jbo.doconnectionpooling = true
    As you can see:
    "At the end of the request when the application module is released back to the application module pool, that application module pool releases the JDBC connection it was using back to the database connection pool. It follows that with jbo.doconnectionpooling set to true the application module instance in the pool may have a completely different JDBC connection each time you check it out of the pool"
    So, the best you can do, is to revert jbo.doconnectionpooling to false.

  • Is it possible to connect database using session bean

    Dear all,
    Is it possible to connect database using session bean without using entity beans like cmp,bmp.
    if ur answer is yes, then pls tell me where to put the select statement and transaction attribute like(6 types).
    if u have sample code, then it is good for me.
    Hope I will get answer.

    Sure it is.
    Try something like this (and maybe get a book on JDBC):
    String name;
    try {
         InitialContext ic = new InitialContext();
         DataSource ds = (DataSource) ic.lookup(Constants.MY_DATASOURCE);
         Connection connection = ds.getConnection();
         String sql = "SELECT * FROM TABLE";
         PreparedStatement statement = connection.prepareStatement(sql);
         ResultSet rs = statement.executeQuery();
         while (rs.next()) {
              name = rs.getString("NAME");
         if (rs != null)
              rs.close();
         if (statement != null)
              statement.close();
         if (connection != null)
              connection.close();
    catch (NamingException e) {
         // Can't get JDBC datasource
         // ... do something with this exception
    catch (SQLException e) {
         // SQL exception from getter
         // .... do seomthing with this one too
    }

  • Connection to the database and session

    Friends I am developing a JSP based application ,and I am storing Connection (to the database) info in a session variable in my main menu , and then I retrieve the connection session in all the pages that I navigate to.
    But a friend of mine told me it is not a good programming practice.He adviced me to use the connection pooling to make effecient use of the connection.
    So using session for storing connection to the database is a bad idea ?
    I thought it is bad idea to get connected to the database everytime a jsp is thrown ...hence I was using session variable.
    Please give ur thought about this.
    Thanks.

    Well.
    You are using a kind of connection pooling already, since you make a connection and reuse it along every jsp page in a session but reusability is at the cut&paste level here.
    And what would you do if you needed to share a connection between sessions (scope:application)
    Or how would you resolve the need to connect to 2 databases in one JSP page ?? Duplicate the code from the "main menu" ?
    If you have let's say 5 applications written as you described and the connection data (ip address, SID, host) changes as someone moves the database to another machine (for example :-))) you will have to manually correct all 5 applications. So it's not much of flexibility in this kind of code.
    Connection pooling as I understood it (I might be wrong :-))) is placing the code in a bean or servlet and the parameters in a txt (or better xml) file so when something changes you don't rewrite applications, just rewrite one txt (xml) file and you are done.
    If you use a connection pool as a bean you have the bean scopes you can choose from and so on.....
    Visit
    http://www.codestudio.com/index.shtml
    for an example of a very well written connection pool. Maybe there you will find other issues to help you decide.
    Hope this helps!
    Bye

  • Can I connect with Database using Session Bean

    Hi,
    I am new to EJB. I have small doubt.
    can I connect with Database using Session Bean.
    Regards,
    Murali.

    Double post of http://forum.java.sun.com/thread.jspa?threadID=687239&tstart=0

  • Persist Database connection over user's session

    On portal 3.0.9 with JPDK v1 I have a web provider that has a jsp portlet. The portlet has multiple pages which are navigated useing a parameter specified with the pageParameterName tag in the provider.xml. Each page needs to be able to access the database and to allow a rollback for all a users actions until a certain page is visited I need a way for all the access to be done through one database connection.
    Putting the dbOpen tag in the event:session_OnStart tag of my globals.jsa file doesn't work (I'm not sure the event:session_OnStart is even executed) and trying to create the connection once with the scope="session" creates an error. Any help would be appreciated.

    Generally speaking, persisting a connection over a users session is a BAD idea. If you really need to do it you simply be able to add the Connection object to the session. However, I would strongly recommend that you review your model because it will not scale.

  • In RAC Database All sessions are connecting to Node1 only

    Hi Gurus,
    Oracle RAC 10R2.
    OS: IBM AIX
    We have two node RAC instance. When I checked, all sessions are connecting to NODE1. and node2 is not having any worload.
    can you guys suggected me from where I start troubleshooting.
    Thanks,
    Chinmay

    Hi Chinmay,
    Check for active_instance_count parameter in database.If it's value is 1, database connection will go to only one instance.To check to which instance it will go you can use below query.
    select INSTANCE_NAME,HOST_NAME,INSTANCE_ROLE from gv$instance;
    Instance_role has two value: active instance (=primary instance) or a passive instance (secondary instance).
    Connection will always go to active instance only.
    Regards
    Sushant

  • Questions about the database connection

    hi all,
    I am developing a project with JDeveloper 10g and I created a database connection to my Oracle RAC database.
    However, whenever I start the project with the JDeveloper and I do a "netstat -an" with the command prompt window. I show there are over 100 connection ESTABLISHED to my database. I don't have any idea how this happens. The problem is since there are over 100 connection established, I couldn't run the project with the JDeveloper's embedded OC4J.
    Can anyone help me to fix this problem?

    I have set the Max connections to 30 in the connection-pool setting of my project in the Embedded OC4J Server Preferences, but it doesn't work.
    There are still over 100 connections to the database...

  • Database connectivity question?

    when I select the OLE DB provider is "microsoft OLE DB provider for
    ODBC Drivers",I can write to database,but I can't read from database
    using data connectivity toolkit?
    but when I select the OLE DB provider is "microsoft JET 4.0 OLE DB
    provider"
    that's no problem.i don't known why?
    thank you in advance!
    [email protected]

    ebarker wrote in message news:<[email protected]>...
    > Please look at the
    > href="http://www.ni.com/pdf/manuals/321525c.pdf">LabVIEW Database
    > Connectivity User Manual, specifically chaper 2, as it explains in
    > great detail the differences between the two different providers.
    > Good luck!
    I have saw LabVIEW Database Connectivity User Manual,I can't get some
    useful information.
    when I select the OLE DB provider is "microsoft OLE DB provider for
    ODBC Drivers",I can write to database,but I can't read from database
    using data connectivity toolkit?I stored data in access database (.db
    file) and i use the SQL language:
    SELECT * FROM motor WHERE serial="aaa"
    the error is :
    "error-21472179
    04 occurred at conn Execute.vi-fetch record.vi(myvi).
    possible reasons:
    Invlid string:specified field does not exist or contains an
    unsupported character"
    but when I select the OLE DB provider is "microsoft JET 4.0 OLE DB
    provider" ,i can read the record using the same language.

  • Brand newbie question on database connection

    I'm brand new to Oracle databasing and am having trouble figuring out how to set up a connection to an existing database. Specifically, I'm not clear at all about the use of the tnsname.ora file. What I'm trying to do is set up a connection using an .asp page to connect to this database. I'm using :
         objConnect.Open ("Provider=MSDASQL;DRIVER={Microsoft ODBC for Oracle};Server=F12_PROD_MARS.WORLD;UID=FLGI;PWD=FLGI")
    [/CODE]
    Which gives me the "ORA-12154: TNS:could not resolve service name" error. I know the information that I need in my tnsname.ora file is:F12_PROD_MARS =
    (DESCRIPTION=
    (ADDRESS_LIST=
    (ADDRESS=
    (PROTOCOL=TCP)
    (Host=172.31.xx.xx)
    (Port=1521)
    (ADDRESS=
    (PROTOCOL=TCP)
    (Host=172.31.xx.xx)
    (Port=1526)
    (CONNECT_DATA=
    (SID=MARS)
    I don't know where the tnsname.ora file is supposed to be located or how to reference it from .asp or anything like that though. The only database connection experience I have is with my own access databases, but none trying to connect to someone elses oracle db. Any help at all or a link to some kind of starters guide would be much appreciated. Also, I downloaded pl/sql developer, but I cannot log on to that either. I don't know if its the same connection issue here, but I know my user/pass for the server is correct, what do I enter for database, so that the application knows where to go? Thanks again... -ST

    objConnect.Open ("Provider=MSDASQL;DRIVER={Microsoft
    t ODBC for
    Oracle};Server=F12_PROD_MARS.WORLD;UID=FLGI;PWD=FLGI")I take it you have the Oracle Client installed on the web app server i.e. where the MS ODBC driver lives
    ODBC now looks for tns name "f12_prod_mars.world" ...
    Which gives me the "ORA-12154: TNS:could not resolve service name" error.
    I know the information that I need in my tnsname.ora file is:
    F12_PROD_MARS =
    ... because it looks for that name, including .world, and cant find it. Name "f12_prod_mars" is not the same name, obviously. (like test.com and test.se are different)
    I don't know where the tnsname.ora file is supposed
    to be located or how to reference it from .asp orWhere is it located now? If you search the harddrives for tnsnames.ora, what do you get?
    connection issue here, but I know my user/pass for
    the server is correct, what do I enter for database,
    so that the application knows where to go? ThanksIf an app, like sql*plus, is asking for "Database:" it often means you give the tns name (=the alias for the tns connect descriptor, which is the thing with lots of ('s and )'s) :)
    Message was edited by:
    orafad

Maybe you are looking for

  • Aperture 3 and iPad 1

    I am using Aperture 3 on Lion and an iPad 1 connected via the latest version of iTunes. The issue I am having is that individual photos out of my projects will not sync onto my iPad. I have generated previews of different sizes, I have repaired the m

  • Installing Oracle Apps 11i (11.5.7) on W2K Server, Bootstrap Failed

    Installing Oracle Apps 11i (11.5.7) on W2K Server: System Configuration: Oracle 11i E-Business Suite 11.5.7 Windows 2000 Server with Service Pack 2 Microsoft VC++ Installed from Microsoft Visual Studio 6.0 MKS tool kit for Developers 8.1 Gnu -> make-

  • What is the latest version of EJB ?

    a) what is the latest version of EJB ? and b) what was the version prior to the latest version ? Any good book suggestion for option - b

  • C++ class question

    Hi, I have written a code for simulation of an N-body problem. The code compiles with a C++ compiler, but it is mainly plain C (no classes/objects, for now). The code uses a structure to encapsulate each particles' information (position, mass, etc.)

  • Throwing a pop up after a selection in F4 search help

    Hi, I have attached a search help to a parameter in selection screen. I am getting the values in F4 help properly. I want to throw a pop-up, after the user selects any value in the search help. asking the user to enter some input. If the user clicks