ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Pannell <steven.pann...@zooplus.com>
Subject RE: make DB call for every new connection
Date Thu, 05 Jan 2006 08:15:12 GMT
Hi Nathan,

Well in oracle you can set the CLIENT_INFO user variable for a session.

BEGIN
DBMS_APPLICATION_INFO.SET_CLIENT_INFO ('JOB UPDATE STOCK'); 
END;

This means you can view which applications are running on your database by
querying the session view client_info column.  If you have many java jobs
running on a database it's not always possible to see which job is really
belonging to which session.

So set the CLIENT_INFO via the DBMS_APPLICATIONS package for each connection
giving the name of the job as a value and you can quickly see what app is
really running. Nice and easy.  You can also add an UPDATED_BY column to
each table, set a trigger and save the CLIENT_INFO to each updated row, this
make determining who did what easier (for debugging odd data changes). sure
you can use auditing, but it's not the same.

S.


-----Original Message-----
From: Nathan.Maves@Sun.COM [mailto:Nathan.Maves@Sun.COM]
Sent: 04 January 2006 17:12
To: user-java@ibatis.apache.org
Subject: Re: make DB call for every new connection


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Out of pure curiosity why would you do something like this.  What  
does it buy you?

Nathan

On Jan 4, 2006, at 6:59 AM, Steven Pannell wrote:

> Hi,
>
> I want to set some session infomation for a connection I make using  
> ibatis
> on my oracle database.  This works fine as follows:
>
> client.queryForObject("setClientInfo",null);
>
> executes a stored procedure and sets my session data.  But there is a
> problem.  ibatis allows for multiple connections thus next time I  
> make a DB
> query I could get a new connection to oracle and thus my session  
> infomation
> is not set for that connection.
>
> Is there a way around this problem, that everytime a new connection  
> it made
> using ibatis to my database it makes a call to my stored  
> procedure.  I want
> a kind of new connection listener. Captures a connection has been  
> made and
> does something.
>
> know what I mean?
>
> thx.
> Steve.
>
>
> ---------------------------------------------------------------------- 
> --
> Steven Pannell
> Technical Project Manager
> zooplus AG
> Eichenweg 4 Rg.
> 85774 Unterföhring
> Tel: +49 (89) 95006-163
> Fax: +49 (89) 95006-500
> steven.pannell@zooplus.com
> http://www.zooplus.de
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFDu/PWIctU6cqxUyYRAqLwAJ0QRFxB9oL2yevppZ2cxHoZUQCnawCfUQu0
Q2MKorDSnQSFv6C6dhPSdvw=
=y17k
-----END PGP SIGNATURE-----

Mime
View raw message