[Firebird-devel] [FB-Tracker] Created: (CORE-3984) [Attempt to reopen an open cursor] in Execute-Fetch-Cancel-Close-Execute-Fetch-Error

2012-11-16 Thread Kovalenko Dmitry (JIRA)
[Attempt to reopen an open cursor] in 
Execute-Fetch-Cancel-Close-Execute-Fetch-Error


 Key: CORE-3984
 URL: http://tracker.firebirdsql.org/browse/CORE-3984
 Project: Firebird Core
  Issue Type: Bug
  Components: API / Client Library, Engine
Affects Versions: 2.5.2
 Environment: Win7, x64.
Reporter: Kovalenko Dmitry


Server Version  :2.5.3.26543 [Windows, SuperClassic, 64bit]
Client Version  :2.5.3.26543 [Windows, 32bit]
Database ODS:11.2
Database Dialect:3

Connection through localhost.

Work from 32bit application.

---
Common scenario:
1. thread1: execute statement select ID,DUMMY from 
SP_PAUSE_FETCH(1000,1000)
2. thread2: fetch one row
3. thread1: cancel fetch (and wait the finish of cancelation)
4. thread1: close cursor
5. thread1: execute statment again
6. thread2: fetch one row - ERROR Attempt to reopen an open cursor

---
Sequence of ISC API calls:
11:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#01]: 
isc_dsql_allocate_statement(...,db_handle=0002,stmt_handle=)
12:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#01]: 
isc_dsql_allocate_statement(...,db_handle=0002,stmt_handle=0004) 
return OK.
13:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#02]: 
isc_dsql_prepare(...,tr_handle=0003,stmt_handle=0004,...)
[stmt_text len:50]
select ID,DUMMY from SP_PAUSE_FETCH(1000,1000)
[/stmt_text]
14:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#02]: 
isc_dsql_prepare(...,tr_handle=0003,stmt_handle=0004,...) return OK.
15:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#03]: 
isc_dsql_execute2(...,tr_handle=0003,stmt_handle=0004,...)
16:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#03]: 
isc_dsql_execute2(...,tr_handle=0003,stmt_handle=0004,...) return OK.
17:[Thr 2284][16.11.2012 12:51:57]ISC_API_IN [#04]: 
isc_dsql_fetch(...,stmt_handle=0004,...)
18:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#05]: 
fb_cancel_operation(,db_handle=0002,option=3)
19:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#05]: 
fb_cancel_operation(,db_handle=0002,option=3) return OK.
20:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#06]: 
fb_cancel_operation(,db_handle=0002,option=3)
21:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#06]: 
fb_cancel_operation(,db_handle=0002,option=3) return OK.
22:[Thr 2284][16.11.2012 12:51:57]ISC_API_OUT[#04]: 
isc_dsql_fetch(...,stmt_handle=0004,...) return ERROR [335544794]
operation was cancelled
23:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#07]: 
isc_dsql_free_statement(...,stmt_handle=0004,1)
24:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#07]: 
isc_dsql_free_statement(...,stmt_handle=0004,1) return OK.
25:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#08]: 
isc_dsql_execute2(...,tr_handle=0003,stmt_handle=0004,...)
26:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#08]: 
isc_dsql_execute2(...,tr_handle=0003,stmt_handle=0004,...) return OK.
27:[Thr 2284][16.11.2012 12:51:57]ISC_API_IN [#09]: 
isc_dsql_fetch(...,stmt_handle=0004,...)
28:[Thr 2284][16.11.2012 12:51:57]ISC_API_OUT[#09]: 
isc_dsql_fetch(...,stmt_handle=0004,...) return ERROR [335544569]
Dynamic SQL Error
SQL error code = -502
Attempt to reopen an open cursor
29:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#10]: 
isc_dsql_free_statement(...,stmt_handle=0004,1)
30:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#10]: 
isc_dsql_free_statement(...,stmt_handle=0004,1) return OK.
31:[Thr 10032][16.11.2012 12:51:57]ISC_API_IN [#11]: 
isc_dsql_free_statement(...,stmt_handle=0004,2)
32:[Thr 10032][16.11.2012 12:51:57]ISC_API_OUT[#11]: 
isc_dsql_free_statement(...,stmt_handle=,2) return OK.

-
In line 23-24 I close my open cursor
In line 25-26 I re-execute statement

Why in line 28 (operation #09) I obtain the error Attempt to reopen an 
open cursor ?

-- [Test stored procedure] 
CREATE PROCEDURE SP_PAUSE_FETCH(N INTEGER, PAUSE INTEGER) 
 RETURNS (ID INTEGER,DUMMY VARCHAR(32000)) 
AS 
 DECLARE VARIABLE P INTEGER; 
 DECLARE VARIABLE S INTEGER; 
BEGIN 
 ID=0; 

 DUMMY=''; 
 P=0; 
 WHILE(P32000)DO 
 BEGIN 
  DUMMY=DUMMY||'A'; 
  P=P+1; 
 END 

 S=0; 
 WHILE(S=0)DO 
 BEGIN 
  P=0; 
  WHILE(PPAUSE) DO P=P+1; 

  IF(IDN)THEN 
  BEGIN 
   ID=ID+1; 
   SUSPEND; 
  END 
  ELSE 
  BEGIN 
   S=1; 
  END 
 END 
END 
-- [/Test stored procedure] 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: 

Re: [Firebird-devel] Servicemanager output isc_spb_rpr_list_limbo_trans

2012-11-16 Thread Mark Rotteveel
On 11-10-2012 09:39, Alex Peshkoff wrote:
   On 10/10/12 22:53, Mark Rotteveel wrote:
 Does anyone have a good description of the output of the servicemanager
 repair option isc_spb_rpr_list_limbo_trans.

 Or if no such description exists, could someone point me to the code
 that generates that output?

 I need this to fix http://tracker.firebirdsql.org/browse/JDBC-266

 Mark, it returns isc_info_svc_limbo_trans information item. A good way
 to parse it is in utilities/fbsvcmgr/fbsvcmgr.cpp, near line 691 (line
 number in trunk).

Am I correct to assume that isc_spb_rpr_list_limbo_trans will only 
return the info items:
- isc_spb_tra_id (?),
- isc_spb_single_tra_id and
- isc_spb_multi_tra_id

And will not include the isc_info_svc_limbo_trans items:
- isc_spb_tra_state,
- isc_spb_tra_host_site,
- isc_spb_tra_remote_site and
- isc_spb_tra_db_path

What is a simple way to get Firebird to include a isc_spb_tra_id and a 
isc_spb_multi_tra_id item in the infoblock (to test this)?

Mark
-- 
Mark Rotteveel

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Servicemanager output isc_spb_rpr_list_limbo_trans

2012-11-16 Thread Alex Peshkoff
On 11/16/12 17:58, Mark Rotteveel wrote:
 On 11-10-2012 09:39, Alex Peshkoff wrote:
On 10/10/12 22:53, Mark Rotteveel wrote:
 Does anyone have a good description of the output of the servicemanager
 repair option isc_spb_rpr_list_limbo_trans.

 Or if no such description exists, could someone point me to the code
 that generates that output?

 I need this to fix http://tracker.firebirdsql.org/browse/JDBC-266
 Mark, it returns isc_info_svc_limbo_trans information item. A good way
 to parse it is in utilities/fbsvcmgr/fbsvcmgr.cpp, near line 691 (line
 number in trunk).
 Am I correct to assume that isc_spb_rpr_list_limbo_trans will only
 return the info items:
 - isc_spb_tra_id (?),
 - isc_spb_single_tra_id and
 - isc_spb_multi_tra_id

 And will not include the isc_info_svc_limbo_trans items:
 - isc_spb_tra_state,
 - isc_spb_tra_host_site,
 - isc_spb_tra_remote_site and
 - isc_spb_tra_db_path

Sorry, you are wrong.

 What is a simple way to get Firebird to include a isc_spb_tra_id and a
 isc_spb_multi_tra_id item in the infoblock (to test this)?

That depends upon what we call simple :)
I do not know a way without API programming. You should start multiple 
transaction, precommit it and abort your program. After it you will 
have  limbo transaction.


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Servicemanager output isc_spb_rpr_list_limbo_trans

2012-11-16 Thread Mark Rotteveel
On 16-11-2012 15:38, Alex Peshkoff wrote:
 Am I correct to assume that isc_spb_rpr_list_limbo_trans will only
 return the info items:
 - isc_spb_tra_id (?),
 - isc_spb_single_tra_id and
 - isc_spb_multi_tra_id

 And will not include the isc_info_svc_limbo_trans items:
 - isc_spb_tra_state,
 - isc_spb_tra_host_site,
 - isc_spb_tra_remote_site and
 - isc_spb_tra_db_path

 Sorry, you are wrong.

Are those items (and isc_spb_tra_advise which I forgot above) only 
available for isc_spb_multi_tra_id?

 What is a simple way to get Firebird to include a isc_spb_tra_id and a
 isc_spb_multi_tra_id item in the infoblock (to test this)?

 That depends upon what we call simple :)
 I do not know a way without API programming. You should start multiple
 transaction, precommit it and abort your program. After it you will
 have  limbo transaction.

The Jaybird tests are capable of creating limbo transactions (see 
createLimboTransaction(int count) in 
http://firebird.svn.sourceforge.net/viewvc/firebird/client-java/trunk/src/test/org/firebirdsql/management/TestFBMaintenanceManager.java?revision=57355view=markup
 
). Those however are only isc_spb_single_tra_id.

The problem was that FBMaintenanceManager.listLimboTransactions() only 
looked for isc_spb_single_tra_id and made a mess when it received other 
info-items. So I would prefer a test where I have all possible 
info-items in the output of isc_spb_rpr_list_limbo_trans.

On a related note: Is there also a way to artificially raise the 
transaction id on a newly created database or to even enforce a specific 
transaction id without resorting to iteratively creating a large number 
of transactions? The original code had some oddities in how it decoded 
integers (which actually contributed to the problem).

Mark
-- 
Mark Rotteveel

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Firebird 3, time to rename conflict names ?

2012-11-16 Thread Philippe Makowski
Hi all,

we have some binaries that have conflict name with other products :
isql (UNIX-ODBC) and gstat (Ganglia)

may be Firebird 3 is the good time frame to rename our binaries ?

for example :
fb_sql, fb_bak, fb_sec, fb_fix, fb_stat, fb_nbackup, fb_qli, fb_pre,
fb_split, fb_qli

-- 
Philippe Makowski
http://www.ibphoenix.com
Supporting users of Firebird
Tel +33 (0) 561058813
Tel +33 (0) 616179800

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 3, time to rename conflict names ?

2012-11-16 Thread Leyne, Sean


 may be Firebird 3 is the good time frame to rename our binaries ?
 
 for example :
 fb_sql, fb_bak, fb_sec, fb_fix, fb_stat, fb_nbackup, fb_qli, fb_pre, fb_split,
 fb_qli

I would suggest:

fb_backup, fb_security, fb_fixup, fb_stats and fb_precompile

I realize that the names are longer than the original, but they are much more 
meaningful (long gone are the days of 8.3 filenames).  

To mitigate the new names, perhaps we can problem soft-links/shortcuts for the 
original names.


Sean


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 3, time to rename conflict names ?

2012-11-16 Thread marius adrian popa
I agree with the longer names , is also better for readability and
firebird manual seo

On Fri, Nov 16, 2012 at 9:38 PM, Leyne, Sean s...@broadviewsoftware.com wrote:


 may be Firebird 3 is the good time frame to rename our binaries ?

 for example :
 fb_sql, fb_bak, fb_sec, fb_fix, fb_stat, fb_nbackup, fb_qli, fb_pre, 
 fb_split,
 fb_qli

 I would suggest:

 fb_backup, fb_security, fb_fixup, fb_stats and fb_precompile

 I realize that the names are longer than the original, but they are much more 
 meaningful (long gone are the days of 8.3 filenames).

 To mitigate the new names, perhaps we can problem soft-links/shortcuts for 
 the original names.


 Sean


 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 Firebird-Devel mailing list, web interface at 
 https://lists.sourceforge.net/lists/listinfo/firebird-devel

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 3, time to rename conflict names ?

2012-11-16 Thread Adriano dos Santos Fernandes
On 16-11-2012 17:23, Philippe Makowski wrote:
 Hi all,
 
 we have some binaries that have conflict name with other products :
 isql (UNIX-ODBC) and gstat (Ganglia)
 
 may be Firebird 3 is the good time frame to rename our binaries ?
 
 for example :
 fb_sql, fb_bak, fb_sec, fb_fix, fb_stat, fb_nbackup, fb_qli, fb_pre,
 fb_split, fb_qli
 

Why do use underlines when fb alone is a good prefix (that don't mess
with the next word)?


Adriano

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 3, time to rename conflict names ?

2012-11-16 Thread Doug Chamberlin
Why not use underlines?

On 11/16/12 6:34 PM, Adriano dos Santos Fernandes wrote:
 Why do use underlines when fb alone is a good prefix (that don't mess
 with the next word)?


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 3, time to rename conflict names ?

2012-11-16 Thread Roman Simakov
I like long names and do not like underlines. It's more faster to type
a name without underline.

2012/11/17 Doug Chamberlin chamberlin.d...@gmail.com:
 Why not use underlines?

 On 11/16/12 6:34 PM, Adriano dos Santos Fernandes wrote:
 Why do use underlines when fb alone is a good prefix (that don't mess
 with the next word)?


 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 Firebird-Devel mailing list, web interface at 
 https://lists.sourceforge.net/lists/listinfo/firebird-devel



-- 
Roman Simakov

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Firebird 3, time to rename conflict names ?

2012-11-16 Thread marius adrian popa
I agree on ubuntu i have isql-fb and is a lot faster to type than isql_fb




On Sat, Nov 17, 2012 at 8:58 AM, Roman Simakov roman.sima...@gmail.com wrote:
 I like long names and do not like underlines. It's more faster to type
 a name without underline.

 2012/11/17 Doug Chamberlin chamberlin.d...@gmail.com:
 Why not use underlines?

 On 11/16/12 6:34 PM, Adriano dos Santos Fernandes wrote:
 Why do use underlines when fb alone is a good prefix (that don't mess
 with the next word)?


 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 Firebird-Devel mailing list, web interface at 
 https://lists.sourceforge.net/lists/listinfo/firebird-devel



 --
 Roman Simakov

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 Firebird-Devel mailing list, web interface at 
 https://lists.sourceforge.net/lists/listinfo/firebird-devel

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel