Bug 212133

Summary: preparing jdbc connection
Product: z_Archived Reporter: gernot <verkehr>
Component: BIRTAssignee: Mingxia Wu <mwu>
Status: NEW --- QA Contact: Tianli Zhang <tzhang>
Severity: enhancement    
Priority: P4 CC: lzhu, wenfeng.fwd, wyan, xxue
Version: 2.2.1Keywords: plan
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description gernot CLA 2007-12-06 06:17:09 EST
There are some events beforeOpen, afterOpen and so on for data sets and data sources. So you can set a jdbc username, password and ...

But there are no means to prepare the connection itself, e.g. to execute a "alter session" or "set role" or "update..." or ...

There's also a missing tearDown event e.g. to update some columns in the db or to record, who was using the report in some log table.

Pelase add "setUp" and "tearDown" events to do something on the jdbc connections.
Comment 1 Wei Yan CLA 2007-12-12 02:11:14 EST
those event should be defined in datasource element.
Comment 2 Lin Zhu CLA 2008-05-05 07:21:25 EDT
Hi There,

For setUp a jdbc connection, I think you can do the requested operation in Data Source before/after open events. And for tearDown a jdbc connection, you can do it in Data Source before/after close events. 

Basically, when a data source is "open", a connection is created. And when a data source is "close", a connection is released. So I think the timing of existing events should be ok.

Any comments?

Thanks.
Lin
Comment 3 gernot CLA 2008-05-07 06:48:41 EDT
There are two requirements:
(1) to do something with the connection, which is "global" - this means for all reports in the same project - this is perfectly done with a specialized  datasource. We are usings that and it works fine.

(2) to do something that's locally for one report. Writing a seperate datasource for each report is not a good approach. It makes datasource pooling inefficient. The behaviour of the report is split among serveral places (data source and rptdesign). You have to deploy (at least) two files and not only one.
So for this case I would like to have some place in rptdesign to do something with the connection (e.g. for some privileged reports to execute "set role" and other stuff).
Comment 4 Lin Zhu CLA 2008-05-28 23:11:42 EDT
(In reply to comment #3)
> There are two requirements:
> (1) to do something with the connection, which is "global" - this means for all
> reports in the same project - this is perfectly done with a specialized 
> datasource. We are usings that and it works fine.
> (2) to do something that's locally for one report. Writing a seperate
> datasource for each report is not a good approach. It makes datasource pooling
> inefficient. The behaviour of the report is split among serveral places (data
> source and rptdesign). You have to deploy (at least) two files and not only
> one.
> So for this case I would like to have some place in rptdesign to do something
> with the connection (e.g. for some privileged reports to execute "set role" and
> other stuff).
> 

Thanks for the update. I am now understand what you want.

As this is a request to add some new script event, suggest to defer to next release.
Comment 5 Lin Zhu CLA 2009-05-05 01:27:58 EDT
We will in future consider add those script event. The current event is designed for ODA driver for general purpose and not specified for JDBC support.