Problem after Upgrade to 8.2.8

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Problem after Upgrade to 8.2.8

Post by jfudickar » Fri 03 Aug 2012 20:40

Hi,

after upgrading to 8.2.8 I got a problem with some realy old and unchanged code:

Code: Select all

function TOdacOracleSQLUtility.InTransaction: Boolean;
var id: Variant;
begin
  if not SessionConnected then
    Result := False
  else
  begin
    DatabaseSession.ExecSQLEx('begin :id :=sys.dbms_transaction.local_transaction_id; end;', ['id', '0']);
    id := DatabaseSession.ParamByName('id').Value;
    Result := VarToStr(id) <> '';
  end;
end;
This leads to the following exception and stack trace

Code: Select all

exception class   : EOraError
exception message : ORA-06502: PL/SQL: numerischer oder Wertefehler: character string buffer too small ORA-06512: in Zeile 1.

main thread ($1f78):
00783395 +0c9 OraToolProUnicode.exe Ora                                  TOraSQL.InternalExecute
7706012e +00a ntdll.dll                                                  KiUserExceptionDispatcher
0073be10 +03c OraToolProUnicode.exe OraClasses                           TOCICommand.Check
0073e7da +25a OraToolProUnicode.exe OraClasses                           TOCICommand.InternalExecute
0073ec0c +1bc OraToolProUnicode.exe OraClasses                           TOCICommand.Exec
00744679 +045 OraToolProUnicode.exe OraClasses                           TOCICommand.DoExecute
007447b9 +0e5 OraToolProUnicode.exe OraClasses                           TOCICommand.Execute
006c256c +058 OraToolProUnicode.exe DBAccess                             TCustomDASQL.InternalExecute
007832fa +02e OraToolProUnicode.exe Ora                                  TOraSQL.InternalExecute
006c26c1 +0c9 OraToolProUnicode.exe DBAccess                             TCustomDASQL.Execute
006c25ef +007 OraToolProUnicode.exe DBAccess                             TCustomDASQL.Execute
006ad649 +115 OraToolProUnicode.exe DBAccess                             TCustomDAConnection.ExecSQLEx
00820daa +07e OraToolProUnicode.exe OdacSQLUtility               312  +5 TOdacOracleSQLUtility.InTransaction
00fecf5e +06a OraToolProUnicode.exe xODACMDIForm                 385  +5 tODACMDIForm.SessionInTransaction
0177ff1e +01e OraToolProUnicode.exe queryfrm                    3827  +4 TQueryForm.SessionInTransaction
0196e835 +01d OraToolProUnicode.exe MAIN                        3663  +2 tOraToolMainForm.RefreshTransactionState
01351427 +023 OraToolProUnicode.exe SingleStatementPageControl  3554  +2 TSingleStatementPageControlFrame.IntDatasetAfterPost
0061d981 +015 OraToolProUnicode.exe DB                                   TDataSet.DoAfterPost
0061cbc1 +075 OraToolProUnicode.exe DB                                   TDataSet.Post
Switching back to 8.2.7 there is no problem.

I know that i can call Session.InTransaction, but I'm more interested in finding the reason for this problem.

Regards
Jens

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Re: Problem after Upgrade to 8.2.8

Post by jfudickar » Sat 04 Aug 2012 10:48

Ok,

because your InTransaction did not recognize all transaction I switched to the following fix:

Code: Select all

function TOdacOracleSQLUtility.InTransaction: Boolean;
var id: Variant;
  emptyString: Variant;
begin
  emptyString   := VarAsType(unassigned, varString);
  if not SessionConnected then
    Result := False
  else
  begin
    DatabaseSession.ExecSQLEx('begin :id :=sys.dbms_transaction.local_transaction_id; end;', ['id', emptyString]);
    id := DatabaseSession.ParamByName('id').Value;
    Result := Not VarIsNullEmpty(id);
  end;
end;
Regards
Jens

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Problem after Upgrade to 8.2.8

Post by AlexP » Mon 06 Aug 2012 10:32

hello,

Thank you for the information.
We have reproduced the problem.
We will notify you as soon as we have any results.

Post Reply