Re: [firebird-support] Re: Can many Execute Blocks be within a Transaction.

2018-03-13 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
13.03.2018 9:30, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote:
> and in Firebird 3 when using the old API (most applications use
> the old API).

   Actually 64k limit is applied to statement in ISC API only if length of 
statement is 
indicated explicitly and function declarations are unmodified. Otherwise it is 
the same as 
in the new API.


-- 
   WBR, SD.






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Re: Can many Execute Blocks be within a Transaction.

2018-03-13 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 13-3-2018 02:12, ho...@agencybusys.com [firebird-support] wrote:
> Thank you, Mark, for such a complete and clear answer. You are a big 
> help to me. What you said agrees and helps me understand what I have 
> read. What I was concerned about was my Execute Blocks were too big, and 
> had to be split into several smaller blocks. I wanted to make sure all 
> the blocks were executed as a single transaction to keep other users 
> from interleaving their updates. You have answered that question quite 
> nicely. Thanks again.

That size limit is the maximum size of 64 kilobyte for statements. This 
limit applies to all statement types, and exists in Firebird 2.5 and 
earlier, and in Firebird 3 when using the old API (most applications use 
the old API). In the new API, the limit has been raised to 10 megabyte.

Mark
-- 
Mark Rotteveel


[firebird-support] Re: Can many Execute Blocks be within a Transaction.

2018-03-12 Thread ho...@agencybusys.com [firebird-support]
Thank you, Mark, for such a complete and clear answer. You are a big help to 
me. What you said agrees and helps me understand what I have read. What I was 
concerned about was my Execute Blocks were too big, and had to be split into 
several smaller blocks. I wanted to make sure all the blocks were executed as a 
single transaction to keep other users from interleaving their updates. You 
have answered that question quite nicely. Thanks again.

[firebird-support] Re: Can many Execute Blocks be within a Transaction.

2018-03-12 Thread ho...@agencybusys.com [firebird-support]
Thank you Karol, I did not want Parallel, so good news. 

Re: [firebird-support] Re: Can many Execute Blocks be within a Transaction.

2018-03-12 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2018-03-12 18:08, ho...@agencybusys.com [firebird-support] wrote:
> I didn't see a way to edit the previous post, so sorry for this
> afterthought.
> 
> My concert are:
> 
>  1. Since the EBs are executed on the Server, will a transaction
> created in Delphi have any benefit for controlling the sequence of
> execution, or the ability to roll back if a failure occurs in block

An execute block is 'simply' an anonymous stored procedure, so it works 
the same as executing stored procedures. And just like stored procedures 
(or any other statement in Firebird), they need to be executed within a 
transaction (your Delphi component likely starts on implicitly if you 
haven't started one explicitly), and just like stored procedures (or 
other statements) it is possible to run more than one in a single 
transaction.

So yes, you can start a transaction and run multiple execute blocks in 
them, and roll back will roll back all executed blocks (assuming you 
don't use IN AUTONOMOUS TRANSACTION DO within your execute block).

> 2-n.
> 2. Once the EBs are submitted to the server, is there any way to
> control the order in which they execute. In other words, are they
> executed in serial or parallel.

If your EXECUTE BLOCK does not contain any SUSPEND statements, then your 
application will be blocked until it is complete; control is only 
returned when execution is done. If your EXECUTE BLOCK has SUSPEND 
statements, then you should not forget to fetch all rows, otherwise it 
will not have any effect (this is the same as when executing executable 
vs selectable stored procedures).

So, without SUSPEND execute block is complete after execute is done and 
it cannot be executed in parallel. If your execute block has SUSPEND, 
you can interleave fetches between the different blocks, although I 
suggest you don't do that, because in general that would lead to hard to 
follow code (and consume more resources). However, even here, only one 
statement is 'active' at a time (so it is concurrent, but not parallel).

> 3. Do I need to do anything to handle deadlocks if they are executed
> in parallel.

Given they are not executed in parallel, and share the same transaction, 
it should not be possible for deadlocks to occur.

Mark


Re: [firebird-support] Re: Can many Execute Blocks be within a Transaction.

2018-03-12 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,
One transaction have benefits like integrity. If your process must be 
accomplished as a whole it is only good way for this. Your statments are 
executed serial. For parallel you will need many connections at the same time.
Regards,Karol Bieniaszewski
null

[firebird-support] Re: Can many Execute Blocks be within a Transaction.

2018-03-12 Thread ho...@agencybusys.com [firebird-support]
I didn't see a way to edit the previous post, so sorry for this afterthought. 
 My concert are:

 1. Since the EBs are executed on the Server, will a transaction created in 
Delphi have any benefit for controlling the sequence of execution, or the 
ability to roll back if a failure occurs in block 2-n.
 2. Once the EBs are submitted to the server, is there any way to control the 
order in which they execute. In other words, are they executed in serial or 
parallel.
 3. Do I need to do anything to handle deadlocks if they are executed in 
parallel.