Issue 109328 - Statements must been closed after calling a Stored Porcedure in MySQL
Summary: Statements must been closed after calling a Stored Porcedure in MySQL
Status: UNCONFIRMED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.0
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-16 12:45 UTC by sos
Modified: 2013-01-29 21:47 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description sos 2010-02-16 12:45:07 UTC
Using MySQL natice connector 
trye this code

SUB TESTstoredprocedurecall
oBaseContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oDB = oBaseContext.getByName("mysql_native")
oCon = oDB.getConnection("user", "Password")
oStatement = oCon.createStatement()
sSQL1 = "call teststoredprocedure('Parm1', '¨Parm2')" ' must been pased in 
right order
ostatement.execute(sSQL1)' gives True
oResultset1 = ostatement.getresultset
oResultSet1.next
print oResultset1.getstring(1)' confirmes the selection based on parameters
ostatement.close ' must been done otherwise we ran in a 
Exception:'sdbc.SQLExepetion "Commands out of sync, you can not run this 
command now"
'after this exception you need to restart OO or dispose oDB
ocon.close ' just to be sure everyting isclosed
end sub

this  Exception "Commands out of sync, you can not run this command now" make 
the use of "PreparedStatements"  useless
Comment 1 drewjensen.inbox 2010-02-21 16:48:27 UTC
@sos what you describe is true, but I'm not at all sure this is a defect. The
requirment to close your server side cursors is TTBOMK required. having to do so
explicitly is IMO the norm (Basic Python Java), although in some environments,
particular web based tools this requirement may be handled by a library and you
may not explicitly have to manage this.

Comment 2 sos 2010-02-22 08:18:18 UTC
@Drew OK but if we need to do that also with a PreparedStatement ? and later 
(when thins works) also  with a "preparedcall" ?
It makes the "prepare" things useless no ?