Hello, Thanks for the reply. I had tried clean_up call but the next execute segfaults for both Oracle and MySQL backends.
#0 0xb7e74259 in soci::details::statement_impl::execute(bool) () from /usr/local/lib/libsoci_core.so.3.2 #1 0xb7f4c02f in soci::statement::execute (this=0x810da88, withDataExchange=false) at /usr/local/include/soci/statement.h:170 ... load() { _select->execute(); while (_select->fetch()) { .. } _select->clean_up(); } I will try to find the cause if I can. Regards, Faik Uygur ________________________________ Kimden: Mateusz Loskot [mate...@loskot.net] Gönderildi: 19 Temmuz 2013 Cuma 12:05 Kime: SOCI general discussion list Bilgi: Halil Ercikan |SmartSoft Konu: Re: [soci-users] Second execute - fetch select cycle does not seem to return data On 19 July 2013 08:47, Faik Uygur |SmartSoft <faik.uy...@cardtek.com<mailto:faik.uy...@cardtek.com>> wrote: [cid:image51579c.PNG@609f65a0.4ca57386] Faik Uygur |SmartSoft TEKNİK DANIŞMAN, YAZILIM GELİŞTİRME TECHNICAL CONSULTANT, SOFTWARE DEVELOPMENT İTÜ Ayazağa Kampüsü Teknokent ARI3 K:1 NO:102 34469 Maslak İstanbul - Türkiye www.cardtek.com<http://www.cardtek.com/> P +90 212 328 3331 F +90 212 285 4093 M [cid:image951900.PNG@b2e469a7.42acf1fc] Bu e-posta ve muhtemel eklerinde verilen bilgiler kişiye özel ve gizli olup, yalnızca mesajda belirlenen alıcı ile ilgilidir.Size yanlışlıkla ulaşmışsa lütfen göndericiye bilgi veriniz, mesajı siliniz ve içeriğini başka bir kişiye açıklamayınız, herhangi bir ortama kopyalamayınız.Verilen tüm bilgilerin doğruluğu ve bütünlüğünün garantisi verilmemekte olup, önceden bildirilmeksizin değiştirilebilecektir.Bu mesajın içeriği Firmamızın resmi görüşlerini yansıtmayabileceğinden Kartek Kart ve Bilişim Teknolojileri Tic.Ltd.Şti. ( SmartSoft ) hiçbir hukuki sorumluluğu kabul etmez. Hello, I am using soci version 3.2.1 with Oracle backend. I am using prepared statements. If a single row selecting statement is called with stmt->execute(true); - select after select works but if a multiple row returning select statement is used and I use "stmt->execute(false) while (stmt->fetch()) ..." the second run of execute-fetch cycle does not return any data. Am i missing something or is this a bug in Oracle backend. I looked for something like cursor reset, row reset if maybe needed but couldn't find anything related. There is statement::clean_up(), but you should not need to call it, in most cases. Here is some code that would help to understand the problem: --- MyClass { ... private: shared_ptr<statement> _select; ... } void MyClass::setup() { _select.reset(new statement((_session->prepare << "select " "guid, status, lastupdated, " "func_code, dst_host1, dst_port1 " "from sys_cnn " "where status = 1", into(guid), into(status), into(lastupdated), into(func_code), into(dst_host1), into(dst_port1) ))); } bool MyClass::load() { _select->execute(); while (_select->fetch()) { // use data returned from each fetch } return _session->got_data(); } So, AFAIU, your use case is basically equivalent to re-execution of statement as below: T c; statement st = (sql.prepare << "select c from t", into(c)); for (int j = 0; j < 2; ++j) // mimic two calls to load() { st.execute(); while (st.fetch()) { // use c } } This should work and it works for PostgreSQL backend. I don't have access to Oracle at the moment. I may be able to test it over the weekend or next week. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net
<<inline: image51579c.PNG>>
<<inline: image951900.PNG>>
------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________ soci-users mailing list soci-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/soci-users