Defining transaction isolation in BIRT - birt

My BIRT report retrieves data using a SQL query (JDBC datasource). My SQL Server 2005 database
is set to use snapshot transaction isolation.
How do I define the transaction isolation mode in BIRT report designer ?
Programatically it's done calling the datasource method setDefaultTransactionIsolation(4096) (4096 means snapshot isolation).

You handle this in the Data Source properties. After successfully creating your data source in BIRT, double-click it to edit it. Select the "Property Binding" grouping on the left of the editor. You will see a property there called "Isolation Mode". For SQL Server, you would add "SNAPSHOT".
A cool feature of BIRT actually allows this property (and all others on this screen) to be parameterized. Click the formula editory by the text box. There you can either bind the value to a report parameter (this is the most common apprach) or implement some logic to determine the desired value. This give you even more flexibility in case the requirements of the underlying data stroe shift. If/when that happens you will not have to edit your design, only alter the input parameter.

Related

ODI 12c integration knowledge module merge when using reusable mapping

Is there away to use the integration knowledge model Merge when using reusable mapping?
I am able to use the Merge IKM when just using datastores but when I added a reusable mapping the option no longer appears on the IKM drop down.
On the logical tab of your mapping, click on the target datastore. Under the Target tab in the properties pane, change the Integration Type and set it to Incremental Update or None. Then go back in the Physical design and the Merge IKMs should be available in the drop-down.
The Integration Type is a pre-filter for the loading strategies. I personally prefer to set it to None so it doesn't filter out any KM and I can have two different Physical design for the same mapping :
the initial load with an Insert Append IKM and truncate set to true.
the incremental load with a Merge IKM

Invoking an select script through ODI (Oracle Data Integrator)

May I have your opinion on below queries please:
Option 1:
I have select script handy with me which fetch data by joining many source tables and performs some transformations like aggregations (group by), data conversion, sub-string etc.
Can I invoke this script through ODI mapping and return results (transformed data output) can be inserted into target of ODI mapping ?
Option2:
Convert the select script into equivalent ODI mapping by using equivalent ODI transformations , functions , look ups etc and use various tables (tables in join clause) as source of mappings.
Basically develop ODI mapping which is equivalent to provided select script plus a target table to insert records into it.
I need to know pros and cons of both options in above (if option 1 is possible).
Is it still possible to track transformation errors, join source tables and where clause condition related errors etc through ODI with option 1?
Log file for mapping failure will have as granular level details as offered by option 2?
Can I still enable Flow Control at Knowledge Module and redirect select script errors into E$_ error tables provided by ODI?
Thanks,
Rajneesh
Option 1: ODI 12c includes that concept out of the box. On the physical tab of a mapping, click on the source node (datastore). Then in the properties pane, there is the CUSTOM_TEMPLATE option under "Extract Options" menu. This allows to enter a custom SQL statement that will be used instead of the code generated by ODI.
However it is probably less maintainable over time than option 2. SQL is less visual than mapping components. Also if you need to bulk change it, it will be trickier. Changing a component in several mappings can be done with the SDK. Changing SQL code would require to parse it. You might indeed have less information in your operator logs as the SQL would be seen as just one block of code. It also wouldn't provide any lineage.
I believe using Flow Control would work but I haven't tested it.
Option 2 would take more time to complete but with that you would benefit from all the functionalities of ODI.
My own preference would be to occasionally use option 1 for really complex SQL queries but to use option 2 for most of the normal use cases.

BIRT Scripted Data Source using existing JDBC DataSource

I know that my overall problem is generally approached using two of the more common solutions such as a join data set or a sub-table, sub-report. I have looked at those and I am not sure this will work effectively.
Background:
JDBC data source has local data which includes a series of id's that reference a record in a master data repository interfaced via a web service. This is where the need for a scripted data source arises. The data can be filtered on either attributes within the local JDBC data and/or the extended data from the web service. The complication is that my only interface is the id argument to the webservice.
Ideal Solution:
Aside from creating a reporting table or other truly desirable scenarios I am looking to creating a unified data source through a single scripting data source that will handle all the complexities. This leaves the report generation and parameter creation a bit cleaner, hopefully. The idea is to leverage the JDBC query as well as the web service queries in the scripted data source do the filtering and joins and create that singular unified view.
I tried using the following code as a reference to use the existing JDBC connection in the BIRT report definition to execute the query. However if I think my breakdown on what should be in open vs fetch given this came from beforeFactory for a completely different purpose may be giving me errors...truth is I see no errors it just returns 0 records.
a link
I have also found a code snippet to dynamically load a JDBC connection but that seems a bit obtuse and a ton of overhead for what I am needing to do. a link
In short: How in all-that-is-holy do you simply run a query against a database within a scripted data source if you wanted to do. The merit of doing that is another issue, but technically how?
Thanks in Advance!

Add a table to a Linq data context

I have created a new table in my database and want to add it to the data context. If I drag it to the designer surface I get a message telling me the object I am adding uses a different data connection and asking if I want to replace the connection in the designer. I answer no.
I then add a new class to the data context and configure it the same as one in another project where I had dragged the table into the designer surface, and which works, meaning it reads from the database.
The class I added and configured does not attach to the underlying database table and thus does not read from the database.
I suspect a problem I had with the other project resulted from dragging this table to the designer surface and replacing the connection.
Can a new class be attached to or made to use a database table, and if so how?
Thanks a bunch.
I have discovered that you right click on the newly added class and and select "Configure Behavior" then choose a behavior. Evidently I just defined the connection but not how to implement it.
I would, however, warn against any type of modification of an existing dbml file. I have done this many times by adding classes and by dragging and dropping tables to the designer surface. In all cases the database connections have become in-operabel.

Crystal Reports 2008 - parameters from selection criteria are not being used to select to retrieve data from db

I have some reports written in Crystal 2008 using business views. These reports have a date parameter set up and I have a selection on the date defined in the select expert. However, when I run the report it appears to retrieve all the data from the database and only then filter out based on the date. As you can imagine this slows down the report quite a bit. I also clicked on Database-Show SQL Query and confirmed that the date parameter did not appear in the SQL Query. This behavior seems very strange to me. This did not use to happen to me when I used Crystal 8.5 with dictionaries. Is this a limitation using business views?
I did some searching and found that I can create a report using a database command. This helped improve performance on one of my reports but when I tried to do something similar on a different report, even though I was using the database command, it still did not appear in the appear to be doing the selection on the database before retrieving the data and the report took forever to run. I also didn't see the selection in the SQL Query.
Do I need to add the parameter to the database command? Will I be able to prompt the user to enter the value when they run the report?
I hope there is a way to do this properly using business views because otherwise I'll have to rewrite all my reports to use another method.
Any ideas or advice are welcome. Thank you very much!
I had a similar problem. I used the command, but my report was still taking longer than i had hoped to run. so i added a where statement into the command to start checking dates starting from 2009. that sped up my report a little.
you may want to consider creating a stored procedure if you think you are pushing CR to the limit. that may also help sped up the report.
I figured out what the problem is. My business view had fields in it that were formulas. If you try to use selection criteria using a formula, it does not add the criteria to the WHERE clause in the SQL Query. Luckily, I was able to find other fields besides the formula in the business view to do the selection.

Resources