My platform is
Windows 2003 Server Enterprise Edition
Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
I'm using Oracle Objects for OLE, version 11.1
On the MFC client:
oraPar.Add("pub_xx", idp, OPARAMETER_INVAR, OTYPE_NUMBER);
OParameter mP = oraPar.Add("retCur", "", OPARAMETER_INOUTVAR,
OTYPE_CURSOR);
OSqlStmt stmt(*pArg->pODB, "begin
epstest.get_prod_info(

ub_xx,:retCur);
end;", OSQLSTMT_FAILEXEC);
On the server:
procedure get_prod_info (
vpub_xx in spacer_pub.xx%type,
vrefCur out sr.refCur
) as
vroot_xx spacer_pub.xx%type;
vparent_xx spacer_pub.xx%type;
vcid_xx cid_info.xx%type := null;
begin
vroot_xx := vpub_xx;
while vroot_xx is not null and vcid_xx is null loop
select decode(p.powtorka,null,p.cid_xx,null),
(select min(p2.xx) from spacer_pub p2,makieta m
where p.powtorka is not null and p2.mak_xx=m.xx and
m.kiedy=sr.powtseed+p.powtorka and
p2.adno=nvl(p.old_adno,p.adno))
into vcid_xx,vparent_xx from spacer_pub p where p.xx=vroot_xx;
vroot_xx := vparent_xx;
end loop;
open vrefCur for
select bbox,kolor from cid_info where xx=nvl(vcid_xx,-1);
exception
when others then
open vrefCur for select 1 from dual where 0=1;
end get_prod_info;
This works fine in single threaded application.
When I'm using several thread serialized on database client level
(oo4o initialized by OStartup(OSTARTUP_APARTMENTTHREADED)

it throws:
Error in SQL statement, ORA-24334: no descriptor for this position
or
Error fetching data, ORA-24334: no descriptor for this position
or sometimes:
Error fetching data, ORA-01403: no data found
It happens one time per 1000 calls on average, but the
application is business critical and it can't go this way.
I did not use OStartup(OSTARTUP_MULTITHREADED) as it doesn't work
with other MFC-OLE stuff (copy-paste automation). The error is "COM not
initialized"
Is this application level error, e.g. my mistake or Oracle problem?
Any suggestions will be apreciated
Regards,
Marcin