Hello,

I have a sp that do an insert and after that a for select.
Ex:
CREATE PROCEDURE GET_PLAGES
(IDPLAGE INTEGER)
RETURNS (
    IDPLAGE INTEGER,
    DEBUT INTEGER,
    FIN INTEGER,
    SHORTDESCIPTION VARCHAR(2000))
AS
begin
  insert into plage(debut, fin, shortdesciption)
  values (:debut, :fin, :shortdesciption);

  for select idplage, debut, fin, shortdesciption
  from plage
  into :idplage, :debut, :fin, :shortdesciption
  DO
   suspend;
end

To use it i do that :

FbConnection conn = new FbConnection(myconnection);
FbCommand cmd = new FbCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GET_PLAGES";
cmd.Parameters.Add(new FbParameter("@IDPLAGE", FbDbType.Integer));
cmd.Parameters[0].Value = 1;
conn.Open();
IDataReader res = cmd.ExecuteReader();
while (res.Read())
{
  // azerty
}

With that the insert is never commit and if i try to reexecute this sp 
with this code the programm is blocked in the line "while 
(res.Read())".
And i must restart the fbserver !
But if i close the connection at the end of this code, i can reexcute 
this code without any problem execpt that the insert is not commited.

I found a solution, is to open a transaction but Why ?



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to