Hi all!

I try to set the min-connections property in the data-sources.xml conf file.
I expect that when I start Orion (or at least at the first database call) it
should establish a number of connections equal to the number specified in my
min-connection property. I also expect these connections to remain open even
if they are inactive for a longer time than specified in the
inactivity-timeout property. Am I right?

But I can't get it to work as described above. When i monitor the number of
connections to the DB it is only as many as the current number of calls. And
then when they have been inactive for as long as specified in the
inactivity-timeout property they are all closed. Totally ignoring my
min-connections property...

Besides from this I think that Orion handles the connection pooling the way
it should (ie reusing connections, keeping them alive as long as specified
in the inactivity-timeout property and so on). When it reaches the number of
connections specified in the max-connections property I get an error
message. So this part seems to work...

Here is examples from my conf files and code:

data-sources.xml:
        <data-source
                class="com.evermind.sql.DriverManagerDataSource"
                name="Ingvar"
                location="jdbc/IngvarDS"
                xa-location="jdbc/xa/IngvarXADS"
                ejb-location="jdbc/IngvarEJBDS"
                pooled-location="jdbc/pool/IngvarPDS"
                username="***"
                password="***"
                url="jdbc:oracle:thin:***/***@Ingvar:1521:INGVAR"
                inactivity-timeout="30"
                connection-driver="oracle.jdbc.driver.OracleDriver"
                max-connections="100"
                min-connections="5"
        />

  public static Connection getConnection() throws Exception {
    try {
      Context ctx = new InitialContext();
      return
((DataSource)ctx.lookup("jdbc/pool/IngvarPDS")).getConnection();
    } catch (Exception e) {
      throw new Exception("Exception: " + e.getMessage());
    }
  }

I get the same behaviour if I try to do the following lookup -
ctx.lookup("jdbc/IngvarEJBDS")

Any input would be appreciated!

/Daniel



Reply via email to