locked
Event handler to send data from SPList to Oracle DB RRS feed

  • Question

  • Hi All,

        I have an Event Handler which has to send data to Oracle DB and it has been created using sandbox mode. I have tried many ways to do that. some of them are,

    i) I have created a web service and tried to invoke the method. The web service works fine in other places, but when used in event handler it comes up with an error. 

    Error Details are: Cannot execute a program. The command being executed was \"C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\csc.exe\" /noconfig /fullpaths @"C:/Users/File path/xyzfhd.cmdline".

    ii) Created an ODBC Data Source for both 32 bit and 64 bit and tested as well (Connection has been successful). when tried to create a method with Data Source to insert the data to Oracle DB. At the OdbcConnection.Open it comes up with this error message.

    Error Details are:

    Error at Open method is : 'conn.serverversion' threw an exception of type 'system.invalidoperationexception'.

    When exception is caught it shows the message as: Request for the permission of type 'System.Data.Odbc.OdbcPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Let me know if you need any other information regarding this.


    Prasad Venkatesan

    Thursday, July 25, 2013 8:16 AM

Answers

  • Hi,

    Sandbox solution will never allow out side connection from within sandbox code. so it's not making any sense to do this.

    some queries.

    1. Do you need to update oracle data real time or after some time span?

    2. How frequently the list is updated? 

    3. Can't you crate farm solution instead of sandbox solution? if you run same code as farm solution it will work fine.

    If answer of point 1 is yes, and if client is fine to update Oracle db after let say every 5 mins, then you can create some service (Web/windows/console app) and schedule it to fetch data from list using lists.asmx service or data.svc wcf service.

    in event handler what ever data you want to send save it as xml item in other list and your service (web/windows/console app) will fetch items from that list and once data is updated in oracle you can remove that xml from list to free up the resources.

    hope this helps.


    Regards, Vikas Patel

    • Marked as answer by Prasad Venkat Thursday, July 25, 2013 12:04 PM
    Thursday, July 25, 2013 9:06 AM

All replies

  • Hi,

    Sandbox solution will never allow out side connection from within sandbox code. so it's not making any sense to do this.

    some queries.

    1. Do you need to update oracle data real time or after some time span?

    2. How frequently the list is updated? 

    3. Can't you crate farm solution instead of sandbox solution? if you run same code as farm solution it will work fine.

    If answer of point 1 is yes, and if client is fine to update Oracle db after let say every 5 mins, then you can create some service (Web/windows/console app) and schedule it to fetch data from list using lists.asmx service or data.svc wcf service.

    in event handler what ever data you want to send save it as xml item in other list and your service (web/windows/console app) will fetch items from that list and once data is updated in oracle you can remove that xml from list to free up the resources.

    hope this helps.


    Regards, Vikas Patel

    • Marked as answer by Prasad Venkat Thursday, July 25, 2013 12:04 PM
    Thursday, July 25, 2013 9:06 AM
  • Thanks Vikas,

            That worked.


    Prasad Venkatesan

    Thursday, July 25, 2013 12:04 PM