>>Now that we are finally moving this app to talk to VFP and Oracle databases, we are wondering if there is any advantage to using a VFP DLL as middleware to handle the SQL calls and returning the cursors or whether we should just create them as classes inside of the app.
>>
>>Comments?
>>
>>Thanks,
>>Steve
>
>
>How about the ability to run your DLLs inside Microsoft Transaction Server.
You will have to be careful how you use MTS with COM Servers. First of all, you can't return cursors from a VFP COM Server to your client. You can return a big string that can be parsed and then populate a local cursor. COM Servers essentially return one record at a time, using properties.
Also, be careful of MTS. MTS is stateless. Here is something you might think you can do, but you can't. step [1]. Create an object on the client that is a COM server and call a method to retrieve matching records, for instance, items for a particular invoice.
ox = createobject('cominvoicedetails')
ox.getdetails('inv-1001') && the invoice number
*-- ox com server should now have a cursor of detail records, right?
*-- retrieve records into memory
DO WHILE .t.
okay = ox.nextrecord()
if !okay
exit
endif
m.line = ox.line
m.qty = ox.qty
etc....
ENDDO
THis will not work with MTS because the object created as ox disappears after each method call! Your reference does not disappear, but MTS might reuse the object so if another user created the same object after you your call to nextrecord might get THEIR next record! You can make no assumptions about the state of an object between method calls while it is part of MTS.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only