Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: AllowStreamedConnected



Permlink Replies: 10 - Last Post: Dec 4, 2015 10:47 AM Last Post By: Jeff Overcash (...
Adalberto Baldini

Posts: 139
Registered: 1/31/12
AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2015 5:33 AM
XE5 I have a DB connected + an IBTransaction active at design time with AllowStreamedConnected set to False.
When I start program I get error Transaction not active.
If I disconnect DB before compile it runs ok.

AllowStreamedConnected = False should connect only when request by program , or not ?

Adalberto Baldini
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 5, 2015 9:30 AM   in response to: Adalberto Baldini in response to: Adalberto Baldini
Adalberto Baldini wrote:
XE5 I have a DB connected + an IBTransaction active at design time with AllowStreamedConnected set to False.
When I start program I get error Transaction not active.
If I disconnect DB before compile it runs ok.

AllowStreamedConnected = False should connect only when request by program , or not ?

Adalberto Baldini

AllowStreamedConnected allows for the component to be active at design time but
even though it is active in the DFM it will not be active during the streaming
process. Once the form/data module is fully constructed that property no longer
has any meaning.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Adalberto Baldini

Posts: 139
Registered: 1/31/12
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 29, 2015 12:37 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
There is a way to prevent error when compiling ?
Compiling often it is boring to get this error and look for transaction remained active.

Regards
Adalberto Baldini
Elton Barbosa

Posts: 9
Registered: 7/19/00
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2015 4:40 AM   in response to: Adalberto Baldini in response to: Adalberto Baldini
Adalberto Baldini wrote:
There is a way to prevent error when compiling ?
Compiling often it is boring to get this error and look for transaction remained active.

Regards
Adalberto Baldini

When AllowStreamedConnected is false, the application start with transaction in status "not active". That is the only thing that you should look for, and your application should start the transaction when needed.
But you said that when you disconnect you don't get an error. This is very weird and I never had this problem as you mention it.
You should create a demo application to show what you are saying. Maybe that way you will or understand what is happening or demonstrate a bug.
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 30, 2015 9:59 AM   in response to: Adalberto Baldini in response to: Adalberto Baldini
Adalberto Baldini wrote:
There is a way to prevent error when compiling ?

What error? I no of no compile time errors or warnings around this.

Compiling often it is boring to get this error and look for transaction remained active.

Regards
Adalberto Baldini

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Adalberto Baldini

Posts: 139
Registered: 1/31/12
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2015 2:42 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
At design time in a form_XX I set TIBDataset.active = True , this automatically set DB.Connected = True.
The DB has AllowStreamedConnected = False, so when application starts DB is not connected and I perform connection.
When I call form_XX I get error :

'Transaction is not active, '

I believe this is caused by status of Dataset and transaction activated at design time.
If I disconnect DB before to compile error doesn't raise.

This error is boring because it raises after I login db and execute process until form_XX. I need to close it , to reset DB.connected , to recompile and to start it again.

Adalberto Baldini
Adalberto Baldini

Posts: 139
Registered: 1/31/12
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2015 2:59 AM   in response to: Adalberto Baldini in response to: Adalberto Baldini
I debugged it putting a stop in form create procedure.
error raises when I Create the form and before to reach the stop.

Adalberto Baldini
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 1, 2015 12:02 PM   in response to: Adalberto Baldini in response to: Adalberto Baldini
Adalberto Baldini wrote:
At design time in a form_XX I set TIBDataset.active = True , this automatically set DB.Connected = True.
The DB has AllowStreamedConnected = False, so when application starts DB is not connected and I perform connection.
When I call form_XX I get error :

'Transaction is not active, '

I believe this is caused by status of Dataset and transaction activated at design time.
If I disconnect DB before to compile error doesn't raise.

This error is boring because it raises after I login db and execute process until form_XX. I need to close it , to reset DB.connected , to recompile and to start it again.

Adalberto Baldini

I need an example. That code hasn't changed in 15 years and this is the first
problem anyone has ever had with it.

Post an example in the attachments group and I'll look at it.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Adalberto Baldini

Posts: 139
Registered: 1/31/12
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 3, 2015 8:23 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Hi Jeff

I prepared test project (113 KB) , as it may depend on my pc I also prepared
a screen capture video (2.133 KB) showing. I didn't include exe.

Tell me where I send these files.

Regards
Adalberto Baldini
quinn wildman

Posts: 856
Registered: 12/2/99
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 3, 2015 8:52 AM   in response to: Adalberto Baldini in response to: Adalberto Baldini
Adalberto Baldini wrote:
Tell me where I send these files.

Post it in the attachments group.
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: AllowStreamedConnected
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2015 10:47 AM   in response to: Adalberto Baldini in response to: Adalberto Baldini
Adalberto Baldini wrote:
Hi Jeff

I prepared test project (113 KB) , as it may depend on my pc I also prepared
a screen capture video (2.133 KB) showing. I didn't include exe.

Tell me where I send these files.

Regards
Adalberto Baldini

Simplest fix is to just set AllowAutoStart to true (the default). This is
happening because the IBDatabase in its loaded method goes in and starts the
transactions that were StreamedActive, but you are creating hte new one after
that has finished.

The first try at the fix on this timing issue is to chant IBTransaction's Loaded to

procedure TIBTransaction.Loaded;
begin
inherited Loaded;
if FStreamedActive and
DefaultDatabase.Connected and
(FHandle = nil) then
StartTransaction;
end;

I could not break it, but really only tried a few different combinations. Copy
IBDatabase.pas to your project's directory, make that change and add that file
to your project.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02