if your db side procedures depends on some package settings you MUST process 
connection 
just after getting connection from connection pool,
 
may be you can use AOP (like Spring AOP) for intercepting connection, 
fist you must know which class and method is gettting connection , 
then define a point-cut for that method, 
inside advice code process the connection, set db side settings,


-----Original Message-----
From: Steven Pannell [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 05, 2006 10:15 AM
To: '[email protected]'
Subject: RE: make DB call for every new connection


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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 04 January 2006 17:12
To: [email protected]
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
> [EMAIL PROTECTED]
> http://www.zooplus.de
>

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

iD8DBQFDu/PWIctU6cqxUyYRAqLwAJ0QRFxB9oL2yevppZ2cxHoZUQCnawCfUQu0
Q2MKorDSnQSFv6C6dhPSdvw=
=y17k
-----END PGP SIGNATURE-----
 
 
Bu elektronik posta mesaji ve ekleri sadece gönderildigi kisi veya kuruma 
özeldir ve gizli bilgiler içerebilir. Eger bu mesaji hataen aldiysaniz lütfen 
bu durumu gönderen kisiye derhal bildiriniz ve mesaji sisteminizden siliniz. 
Eger dogru kisiye ulasmadigini düsünüyorsaniz, bu mesajin gizlenmesi, 
yönlendirilmesi, kopyalanmasi veya herhangi bir sekilde kullanilmasi yasaktir. 
Internet iletisiminde güvenlik ve hatasiz gönderim garanti edilemeyeceginden, 
mesajin yerine ulasmamasi, geç ulasmasi, içeriginin bozulmasi ya da mesajin 
virus tasimasi gibi problemler olusabilir. Gönderen taraf bu tip sorunlardan 
sorumlu tutulmaz.

This e-mail message and any attachments are confidential and intended solely 
for the use of the individual or entity to whom they are addressed. If you have 
received this message in error, please notify the sender immediately and delete 
it from your system. If you are not the intended recipient you are hereby 
notified that any dissemination, forwarding, copying or use of any of the 
information is prohibited. Internet communications cannot be guaranteed to be 
secure or error-free as information could be intercepted, corrupted, lost, 
arrive late or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the context of this message which arise as a 
result of Internet transmission.

Reply via email to