Recent

Author Topic: Error - Transaction of connection not set  (Read 13995 times)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Error - Transaction of connection not set
« Reply #30 on: September 03, 2018, 03:44:23 pm »
First case:

1. Create a new project;
2. Put a IBConection1 on Form1;
3. Create Form2;
4. Put a SQLTransaction2 on Form2;
5. Set SQLTransaction2.Database as Form1.IBConection1;
6. Check Form1.IBConection1.Transaction information.

Why Form2.SQLTransaction2 has became the default transaction of Form1.IBConection1 if Form2 is not even in Form1's uses sections?
Because SQLTransaction2 (which is the control that sets the Transaction property on the IBConnection) has no information of form1's use list nor form2's. You can stop that by setting the IConnection transaction property to something else before setting the SQLTransaction.Database property.
Isn't a bug when design time allows something that run time won't?
NO! its a helping hand it makes things easier to work with.

EDIT: 
  Just a comment to get it out of my system. The uses clause is compiler instructions not run time behavior.
« Last Edit: September 03, 2018, 03:51:52 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Error - Transaction of connection not set
« Reply #31 on: September 03, 2018, 04:04:38 pm »
Second case:

1. Create a new project;
2. Put a IBConection1 on Form1;
3. Create Form2;
4. Put a SQLTransaction2 on Form2;
5. Create Form3;
6. Put a SQLTransaction3 on Form3;
7. Check Form1.IBConection1.Transaction information.

Why Form1.IBConection1 permits see Form2.SQLTransaction2 and Form3.SQLTransaction3 if Form2 and Form3 are not even in Form1's uses sections?

Isn't this case a bug in design time information?
That's a feature of the IDE Designer, once you link a property to a control on an other form it will automatically append that form to the uses clause.
Even if I have hundreds of forms should I see hundreds of undesired information?

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Error - Transaction of connection not set
« Reply #32 on: September 03, 2018, 04:31:53 pm »
Second case:

1. Create a new project;
2. Put a IBConection1 on Form1;
3. Create Form2;
4. Put a SQLTransaction2 on Form2;
5. Create Form3;
6. Put a SQLTransaction3 on Form3;
7. Check Form1.IBConection1.Transaction information.

Why Form1.IBConection1 permits see Form2.SQLTransaction2 and Form3.SQLTransaction3 if Form2 and Form3 are not even in Form1's uses sections?

Isn't this case a bug in design time information?
That's a feature of the IDE Designer, once you link a property to a control on an other form it will automatically append that form to the uses clause.
Even if I have hundreds of forms should I see hundreds of undesired information?
Well now we venture in to the specification realm, which has no technical weight. Here is a fact and my opinion. Fact: You can only select from forms/datamodules loaded in ide, not all of them are usually loaded at the same time but if they are, (Opinion time) then yes you should be able to use anything from anywhere on your project and have the IDE sort out the uses clause for you.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Error - Transaction of connection not set
« Reply #33 on: September 04, 2018, 08:52:18 pm »
It seems that I have discovered what happens, but I am not sure how to reproduce.
I visually configure some SQLTransaction and SQLQuery in a form. When all is right, I save it and close Lazarus.
I open the LFM file in Notepad++ and the information in SQLQuery.Transaction has been saved correctly.
I open the project in Lazarus again and the information in SQLQuery.Transaction is loaded wrongly. It even seems random. It might be related to many open forms simultaneously when saving and loading.
If I recompile that unit, then when I run the application, errors come up and that do not make sense since it worked correctly before.
I reconfigure the SQLQuery.Transaction of that form and the application returns to work.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Error - Transaction of connection not set
« Reply #34 on: September 05, 2018, 09:03:37 am »
It seems that I have discovered what happens, but I am not sure how to reproduce.
I visually configure some SQLTransaction and SQLQuery in a form. When all is right, I save it and close Lazarus.
I open the LFM file in Notepad++ and the information in SQLQuery.Transaction has been saved correctly.
I open the project in Lazarus again and the information in SQLQuery.Transaction is loaded wrongly. It even seems random. It might be related to many open forms simultaneously when saving and loading.
That looks like a huge bug. how repeatable is this? does it hapen every time you load the form or its a bit random?
If I recompile that unit, then when I run the application, errors come up and that do not make sense since it worked correctly before.
I reconfigure the SQLQuery.Transaction of that form and the application returns to work.
I see which means that the problem is on the designer not the streaming mechanism it self.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Error - Transaction of connection not set
« Reply #35 on: September 05, 2018, 01:02:17 pm »
It seems that I have discovered what happens, but I am not sure how to reproduce.
I visually configure some SQLTransaction and SQLQuery in a form. When all is right, I save it and close Lazarus.
I open the LFM file in Notepad++ and the information in SQLQuery.Transaction has been saved correctly.
I open the project in Lazarus again and the information in SQLQuery.Transaction is loaded wrongly. It even seems random. It might be related to many open forms simultaneously when saving and loading.
That looks like a huge bug. how repeatable is this?
As more forms are being added to the project, the bug happens on a daily basis.

Quote
does it hapen every time you load the form or its a bit random?
It seems to happen every time when I load the bug forms, but I could not reproduce it on a small sample project so far.


Quote
If I recompile that unit, then when I run the application, errors come up and that do not make sense since it worked correctly before.
I reconfigure the SQLQuery.Transaction of that form and the application returns to work.
I see which means that the problem is on the designer not the streaming mechanism it self.
I also believe you are right, but I still need to create a small sample project to show the bug happening.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Error - Transaction of connection not set
« Reply #36 on: September 06, 2018, 07:35:23 am »
@mangakissa and @taazz

Bug on Lazarus 1.8.4 and FPC 3.0.4 and Firebird 3.0.3:
Information about Form.SQLQuery.Transaction is saved correctly on LFM file, but is loaded wrongly during design time.
Then, ApplyUpdate(0) gives random errors.

I have a small project (1 data module and 3 forms) build from scratch that shows the problem.
I can send it privately if one of you have some time to debug it and discard it, but it can't become public because of copyright.
We also can't discuss it publicly. We can only talk publicly and generically about IBConnection, SQLTransaction and SQLQuery.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Error - Transaction of connection not set
« Reply #37 on: September 06, 2018, 08:15:31 am »
@mangakissa and @taazz

Bug on Lazarus 1.8.4 and FPC 3.0.4 and Firebird 3.0.3:
Information about Form.SQLQuery.Transaction is saved correctly on LFM file, but is loaded wrongly during design time.
Then, ApplyUpdate(0) gives random errors.

I have a small project (1 data module and 3 forms) build from scratch that shows the problem.
I can send it privately if one of you have some time to debug it and discard it, but it can't become public because of copyright.
We also can't discuss it publicly. We can only talk publicly and generically about IBConnection, SQLTransaction and SQLQuery.
sure, why not, I'll take a closer look at the weekend, I'll pm you an active email address.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Error - Transaction of connection not set
« Reply #38 on: September 06, 2018, 06:00:41 pm »
@mangakissa and @taazz

Bug on Lazarus 1.8.4 and FPC 3.0.4 and Firebird 3.0.3:
Information about Form.SQLQuery.Transaction is saved correctly on LFM file, but is loaded wrongly during design time.
Then, ApplyUpdate(0) gives random errors.

I have a small project (1 data module and 3 forms) build from scratch that shows the problem.
I can send it privately if one of you have some time to debug it and discard it, but it can't become public because of copyright.
We also can't discuss it publicly. We can only talk publicly and generically about IBConnection, SQLTransaction and SQLQuery.
sure, why not, I'll take a closer look at the weekend, I'll pm you an active email address.
I have just sent you an e-mail.
Thanks.

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: Error - Transaction of connection not set
« Reply #39 on: December 07, 2018, 07:39:49 am »
To comment bug report https://bugs.freepascal.org/view.php?id=34648:
If you can select in one DataModule transaction from another DataModule, which is not in USES list then I think, that it is bug.
But this must confirm and fix someone of Lazarus developer. I am not so familiar with streaming system.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Error - Transaction of connection not set
« Reply #40 on: December 13, 2018, 08:15:35 pm »
To comment bug report https://bugs.freepascal.org/view.php?id=34648:
If you can select in one DataModule transaction from another DataModule, which is not in USES list then I think, that it is bug.
But this must confirm and fix someone of Lazarus developer. I am not so familiar with streaming system.
I have opened an apart ticket for this issue:
0034686: Database Settings -> confunsing information and possibility of setting wrong values
https://bugs.freepascal.org/view.php?id=34686
Thanks.

 

TinyPortal © 2005-2018