Is it possible to access the DB connection from a PI using

ivy.getProcessEngineHook().getDbConnection(dbName);

as well as for returning (instead of closing):

ivy.getProcessEngineHook().returnDbConnection(dbName, connection); ?

Is this way of accessing the underlying datasource (for SELECT queries inside a PI) the correct one or does this interfere with other queries from Ivy DB process elements running at the same time?

asked 12.01.2010 at 11:39

Christian%20Schneider's gravatar image

Christian Sc...
(suspended)
accept rate: 0%


This is the right way:

import  java.sql.Connection;   
// connect to the database
Connection dbconnection = ivy.getProcessEngineHook().getDbConnection(dbName);
try
{
  // execute sql queries
} finally {
  // close the connection
  dbconnection.close();
}

Of course, it is possible that at the same time other queries are executed, but this should not be a problem.

link

answered 13.01.2010 at 06:06

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
1.4k102118122
accept rate: 77%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×24

Asked: 12.01.2010 at 11:39

Seen: 2,675 times

Last updated: 24.07.2018 at 09:10