A relevant Helpdesk thread discussed the same thing, and here are Frans' replies in that thread:
The problem is: you want to have a different mapping for "Timestamp with Local Timezone" for the ODP.NET types. This is defined in the driver. As you can understand, the default mapping is the right one: it uses the TimeStampLTZ type. However you want to use TimeStampTZ.
You can achieve that in a couple of ways. The best way IMHO is the one with the driver.
Download the latest SDK from the customer area. In there you'll find the sourcecode of all the drivers. You're using ODP.NET 10g, so you should open the project OracleDBDriver10g. remove all the other projects from the solution. We added BINARY_DOUBLE support on December 14th, so I'd recommend to you to update the runtime library to the latest build as well, as it had a change in the DQE to support this type and better support oracle types.
Ok, open the file OracleDBDriver.cs in the Oracle 10g driver. The mappings are table driven so it's easy to change. The one you want to change is at line 159:
base.DBTypesAsProviderType[(int)OracleDbTypes.TimeStampWithLocalTimeZone] = OracleDbType.TimeStampLTZ.ToString();
You want to change that into:
base.DBTypesAsProviderType[(int)OracleDbTypes.TimeStampWithLocalTimeZone] = OracleDbType.TimeStampTZ.ToString();
Recompile the driver (probably want to remove the key reference in the assembly info file) and place it in the Drivers\Oracle10g folder of the designer. Start the designer and load your project. Then re-generate the code. This should make any TimeStampLTZ field be using TimeStampTZ from now on. The values in the persistenceinfoprovider code are retrieved from this driver table.
The sourcecode is provided to you for these purposes, so you're free to alter the driver sourcecode to make it behave like your project requires.
Another way to make this work is a change in the Oracle DQE, though I think this change is the easiest
In the recent Oracle DQE (since december 14th) that routine has been removed, as it gave too many problems with BINARY_DOUBLE etc.: it was also not really helpful, as it actually did what OracleParameter does internally, so we've stripped it out.
THe downside of adding it to the DQE is that it won't be used with proc calls, if you want to use it there as well.
I think there's another way to do this, by using a template: you can use a different persistenceinfoprovider template by using a different templateID binding (so it comes down to create a copy of the template, alter it, and bind it to the same templateID in a different templatebindings file created with templatestudio. You then place that bindings file above the original one on the second tab in the generator configuration dialog. )
The template is
persistenceInfoProviderAdapter.template
in Templates\Oracle10gSpecific\Net2.x\C#
Add to the bottom of the PersistenceInfoProviderCore class:
Code:
private OracleDbType ConvertTimeZoneTypes(OracleDbType toCheck)
{
OracleDbType toReturn = toCheck;
if(toCheck==OracleDbType.TimeStampLTZ)
{
toReturn = OracleDbType.TimeStampTZ;
}
return toReturn;
}
Then at line 68 in the template, you change:
OracleDbType.<[SourceColumnDbType]>
with
ConvertTimeZoneTypes(OracleDbType.<[SourceColumnDbType]>)
and you should be able to generate the change into your code without library changes. This code runs once, when the application starts.
The problem is: if we change it in the DQE, it will be changed for everyone, also for the people who DO want to use TimeStampLTZ. Therefore we think it's not wise to make that change to the DQE, as it affects everyone.
The latest runtime libs + source are from 23 january 2008.
Ideally, it would be best if there was some kind of mapping override feature in the designer, where you could specify for this particular project to use mapping ABC instead of XYZ. This is what we're considering in v3.