Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. MTS and COM !

MTS and COM !

Scheduled Pinned Locked Moved COM
databasehelpc++sql-servercom
2 Posts 2 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Guru
    wrote on last edited by
    #1

    Hi, I am developing a COM component in VC++. I am deploying the component in MTS. I am using SQl Server 7.0 as my database.Also using ADO recordset and stored procedures.After deploying the component in MTS and run my client, I am getting the following error.Anybody can pls help me in this regard. Error: 07-29-2000--19:46:56-Component CContactDB::GetAllContacts:-2146824584 :Unknown error 0x800A0E78! ADODB.Recordset! The operation requested by the application is not allowed if the object is closed.ÍýýýýÝ GetAllContacts is my own function which will retrieve some info based on a query. Kindly get back to me ASAP. Thanks in advance. Regds guru

    L 1 Reply Last reply
    0
    • G Guru

      Hi, I am developing a COM component in VC++. I am deploying the component in MTS. I am using SQl Server 7.0 as my database.Also using ADO recordset and stored procedures.After deploying the component in MTS and run my client, I am getting the following error.Anybody can pls help me in this regard. Error: 07-29-2000--19:46:56-Component CContactDB::GetAllContacts:-2146824584 :Unknown error 0x800A0E78! ADODB.Recordset! The operation requested by the application is not allowed if the object is closed.ÍýýýýÝ GetAllContacts is my own function which will retrieve some info based on a query. Kindly get back to me ASAP. Thanks in advance. Regds guru

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi Your problem is quite a common one in MTS. the problem may be because you are using a transactional component and the recordset is getting closed before you can access it. You must remember that MTS normally deactivates a component after every method call(thus the expression stateless objects)in which you Complete a transaction. What you must do is to ensure that your state is maintained for as long as you want. Thus the best way would be to use the DisableCommit of the IObjectContext interface at an appropriate place like for example in your IObjectControl::Activate method. This ensures that no transactions are completed until you specify a SetComplete on your IObjectContext method. I would advise making a method which does this SetComplete. Putting cleanup code in FinalRelease of your component is tricky because you cannot know how many times MTS will activate and deactivate your object. rather it is better to either make a cleanup function of your own or use the Deactivate method of IObjectControl. I hope this helps to solve your problem. If not then email me and I can give you some sample code. I am even mailing you a copy of this suggestion.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups