locked
Problems using Oracle.DataAccess with Sync Framework RRS feed

  • Question

  • Hi,
    since Microsoft has deprecated System.Data.Oracle in .NET 4.0, I thought I should try replacing it in my current sync-project with Oracles ODP.NET component. Unfortunately this doesn't work. At least 2 internal data types (OpoDatCtx, OracleDbType.Date and OpoTsCtx, OracleDbType.TimeStamp) are not serializable, which means they cannot be used für SynchAnchor values. I have found references to this problem dating back to 2008.

    How could this be resolved? IMHO I would expect Microsoft to communicate this special requirement to Oracle, allowing them to enhance the ODP component accordingly. Is that the case? Is there any status information available?

    Thanks in advance for any Help.

    Regards

    Uwe
    • Moved by Max Wang_1983 Thursday, April 21, 2011 11:03 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, October 8, 2009 10:06 AM

Answers

  • Hi,

    with the kind help of Alex Keh from Oracle I was able to solve this (I'm using the Oracle Xcopy Client 11.1.0.7.20):

    1. One has to modify the OaracleParameter-Definitions. The constructors of OracleParameter use Oracle DbTypes by default. If you create a parameter with the empty constructor it is later possible to set the DbType property to a .NET-Type (e.g. DbType.DateTime) which is serializable.
    2. The OracleCommand object needs to be modified. Normally, Oracle binds by positon so one needs to set cmd.BindByName to true.

    After those (quite small) modification, the sync process runs smootly with the ODP.NET provider.

    Regards

    Uwe


    • Marked as answer by Uwe Reisewitz Wednesday, October 21, 2009 7:28 PM
    Wednesday, October 21, 2009 7:28 PM

All replies

  • Hi Uwe,

    You may have already seen the reply from Sean Kelley when I raised this issue previously:  http://social.msdn.microsoft.com/forums/en-US/uklaunch2007ado.net/thread/3ab78eb3-0e97-46d4-a2b0-42804664d4ce/

    I have not heard any updates to this since; however, I would not think it necessarily Microsoft's responsibility to communicate this to Oracle (would like to get the product team's perspective on this). Have you posted this to the ODP.NET forum as well?  That may help create further awareness of this issue to Oracle and [hopefully] get them to act upon it.

    Regards,
    Nino
    Please remember to mark replies as answers if they help you.
    Wednesday, October 14, 2009 3:13 PM
  • Hi Uwe,

    The workaround here is to use data types that can be serialized (int perhaps) as sync anchor values (as mentioned in the thread linked in Nino's post).  You could also check out other 3rd party providers.

    Some are listed in the comments section here:
    http://blogs.msdn.com/adonet/archive/2009/06/15/system-data-oracleclient-update.aspx

    -Jesse
    Thursday, October 15, 2009 6:16 PM
  • Hi,

    with the kind help of Alex Keh from Oracle I was able to solve this (I'm using the Oracle Xcopy Client 11.1.0.7.20):

    1. One has to modify the OaracleParameter-Definitions. The constructors of OracleParameter use Oracle DbTypes by default. If you create a parameter with the empty constructor it is later possible to set the DbType property to a .NET-Type (e.g. DbType.DateTime) which is serializable.
    2. The OracleCommand object needs to be modified. Normally, Oracle binds by positon so one needs to set cmd.BindByName to true.

    After those (quite small) modification, the sync process runs smootly with the ODP.NET provider.

    Regards

    Uwe


    • Marked as answer by Uwe Reisewitz Wednesday, October 21, 2009 7:28 PM
    Wednesday, October 21, 2009 7:28 PM