Re: [Firebird-devel] Transaction type

2012-04-24 Thread Claudio Valderrama C.
Ok, I have a patch with my changes, but I don't know if this list accepts
attachments (102 kb).
Or maybe there's some user space at SF for each account, I don't know.

C.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Claudio Valderrama C.
 -Original Message-
 From: Alex Peshkoff [mailto:peshk...@mail.ru] 
 Sent: Lunes, 16 de Abril de 2012 7:22



'Hard' limit can be reached only by gbak's attachment. I.e. 
 with transaction ID
 use of ~0 as special condition should be OK. Certainly, check 
 for 'hard' limit should be done taking that into an account.

Ok, I would like to create a type. If
typedef ULONG TxnType;
is too awkward, suggest something better.

Second, is the transaction type something exclusive to JRD? If yes, it can
be defined in Jrd; if not, it will have to be defined in fb_types.h because
I don't want to deal with circular dependencies.

C.


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Dimitry Sibiryakov
17.04.2012 12:53, Claudio Valderrama C. wrote:
 Ok, I would like to create a type. If
 typedef ULONG TxnType;
 is too awkward, suggest something better.

   Because it is not a transaction itself, but only it's id, I would suggest 
tid_t...

-- 
   SY, SD.

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Vlad Khorsun
 Ok, I would like to create a type. If
 typedef ULONG TxnType;
 is too awkward, suggest something better.

Don't name it TxnType, please. It is transaction *number* and not
an isolation level, for example. We already have RecordNumber and
PageNumber, let be consistent.

Regards,
Vlad

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Dmitry Yemanov
17.04.2012 14:53, Claudio Valderrama C. wrote:

 Ok, I would like to create a type. If
 typedef ULONG TxnType;
 is too awkward, suggest something better.

TxnId or txn_id_t or something like that.


Dmitry

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Alex Peshkoff
 On 04/17/12 14:53, Claudio Valderrama C. wrote:

 Second, is the transaction type something exclusive to JRD? If yes, it can
 be defined in Jrd; if not, it will have to be defined in fb_types.h because
 I don't want to deal with circular dependencies.

It can get out from jrd in at least 2 cases - in system context variable
and in monitoring tables. But this 2 do not require defining in fb_types.h.


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Dimitry Sibiryakov
17.04.2012 12:12, Alex Peshkoff wrote:
 It can get out from jrd in at least 2 cases - in system context variable
 and in monitoring tables.

   Also in the results of isc_transaction_info and isc_database_info.

-- 
   SY, SD.

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Vlad Khorsun
 17.04.2012 14:53, Claudio Valderrama C. wrote:
 
 Ok, I would like to create a type. If
 typedef ULONG TxnType;
 is too awkward, suggest something better.
 
 TxnId or txn_id_t or something like that.

Look, currently we have

SLONG tra_number; // transaction number

compare it with

TxnTypetra_number;
or

TxnIdtra_number;
or

TraNumber tra_number;


Regards,
Vlad

PS I hope we will not going to rename tra_number  ?

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Dmitry Yemanov
17.04.2012 14:20, Vlad Khorsun wrote:

 TraNumber tra_number;

 From another side, it's isc_info_tra_id in API, TRANSACTION_ID in 
context variables and MON$TRANSACTION_ID in the monitoring tables :-)

As for me, both Id and Number are acceptable as suffixes. Just please 
don't make it TraType/TxnType.


Dmitry

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Vlad Khorsun
 17.04.2012 14:20, Vlad Khorsun wrote:
 
 TraNumber tra_number;
 
 From another side, it's isc_info_tra_id in API, TRANSACTION_ID in 
 context variables and MON$TRANSACTION_ID in the monitoring tables :-)

This is another important point. There is user POV and user (public) data 
types, 
such as ISC_SLONG, ISC_QUAD, etc, and there is internal engine POV and engine
data types and first is not necessary exactly matches second one. 

Lets not mix things more than absolutely needed.

  As for me, both Id and Number are acceptable as suffixes. Just please 
 don't make it TraType/TxnType.

I'm not insist in Number over ID but Number looks more consistent for me...

Regards,
Vlad

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Claudio Valderrama C.
 -Original Message-
 From: Vlad Khorsun [mailto:hv...@users.sourceforge.net] 
 Sent: Martes, 17 de Abril de 2012 7:05
 
 I'm not insist in Number over ID but Number looks more 
 consistent for me...

What a sensitive matter! :-)

Ok, let's use TxnNumber or TraNumber; should I define it in JRD? As I see,
this definition will be only useful for JRD, unless some of you insist that
I put it in fb_types.h.

Second, following the same reasoning, should I rename StreamType to
StreamNumber, too? For historical inertia, I tend to use TSomething, but
since we don't follow that convention, I preferred StreamType to TStream and
I don't like full uppercase for types.

C.


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Dmitry Yemanov
17.04.2012 16:34, Claudio Valderrama C. wrote:

 Ok, let's use TxnNumber or TraNumber; should I define it in JRD? As I see,
 this definition will be only useful for JRD, unless some of you insist that
 I put it in fb_types.h.

JRD should be okay.

 Second, following the same reasoning, should I rename StreamType to
 StreamNumber, too?

It sounds as a good idea ;-)


Dmitry

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-17 Thread Claudio Valderrama C.
 -Original Message-
 From: Dmitry Yemanov [mailto:firebi...@yandex.ru] 
 Sent: Martes, 17 de Abril de 2012 7:44
 
 17.04.2012 16:34, Claudio Valderrama C. wrote:
 
  Ok, let's use TxnNumber or TraNumber; should I define it in 
 JRD? As I see,
  this definition will be only useful for JRD, unless some of 
 you insist that
  I put it in fb_types.h.
 
 JRD should be okay.
 
  Second, following the same reasoning, should I rename StreamType to
  StreamNumber, too?
 
 It sounds as a good idea ;-)

Ok, it seems as if we can agree before the next quake hits my country. I'm
getting bored of being shaken these days.
http://earthquake.usgs.gov/earthquakes/?source=sitenav

C.


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Alex Peshkoff
 On 04/15/12 13:50, Claudio Valderrama C. wrote:
 Those functions use -1 to indicate a special condition.

It's nice to use ~0 as a special condition instead -1.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Claudio Valderrama C.
 -Original Message-
 From: Alex Peshkoff [mailto:peshk...@mail.ru] 
 Sent: Lunes, 16 de Abril de 2012 3:00
 
  On 04/15/12 13:50, Claudio Valderrama C. wrote:
  Those functions use -1 to indicate a special condition.
 
 It's nice to use ~0 as a special condition instead -1.

The problem with those solutions is that they assume the max value cannot be
reached normally. Are we sure in this case?

C.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Alex Peshkoff
 On 04/16/12 12:55, Claudio Valderrama C. wrote:
 -Original Message-
 From: Alex Peshkoff [mailto:peshk...@mail.ru] 
 Sent: Lunes, 16 de Abril de 2012 3:00

  On 04/15/12 13:50, Claudio Valderrama C. wrote:
 Those functions use -1 to indicate a special condition.

 It's nice to use ~0 as a special condition instead -1.
 The problem with those solutions is that they assume the max value cannot be
 reached normally. Are we sure in this case?

This depends upon our code checking the case when transaction ID is
reaching it's upper limit. As far as I remember, currently we have a
kind of 'soft' limit trying to stop with reserve about 8 or 16
transactions to make it possible to perform database's backup. 'Hard'
limit can be reached only by gbak's attachment. I.e. with transaction ID
use of ~0 as special condition should be OK. Certainly, check for 'hard'
limit should be done taking that into an account.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Dimitry Sibiryakov
16.04.2012 13:21, Alex Peshkoff wrote:
 I.e. with transaction ID
 use of ~0 as special condition should be OK.

   Doesn't internal transaction have id 0?

-- 
   SY, SD.

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Alex Peshkoff
 On 04/16/12 15:25, Dimitry Sibiryakov wrote:
 16.04.2012 13:21, Alex Peshkoff wrote:
 I.e. with transaction ID
 use of ~0 as special condition should be OK.
Doesn't internal transaction have id 0?

Yes, system transaction has ID == 0.
How is it related?


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Claudio Valderrama C.
 -Original Message-
 From: Dimitry Sibiryakov [mailto:s...@ibphoenix.com] 
 Sent: Lunes, 16 de Abril de 2012 7:25
 
 16.04.2012 13:21, Alex Peshkoff wrote:
  I.e. with transaction ID
  use of ~0 as special condition should be OK.
 
Doesn't internal transaction have id 0?

Alex wrote ~0 instead of 0, did you notice it?

C.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Dmitry Yemanov
16.04.2012 15:38, Dimitry Sibiryakov wrote:

 Not related if system transaction is never passed to these functions.

0  ~0


Dmitry




--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Dimitry Sibiryakov
16.04.2012 14:45, Claudio Valderrama C. wrote:
 Alex wrote ~0 instead of 0, did you notice it?

   Oops, my fault. :(((

-- 
   SY, SD.

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-16 Thread Claudio Valderrama C.
 -Original Message-
 From: Dimitry Sibiryakov [mailto:s...@ibphoenix.com] 
 Sent: Lunes, 16 de Abril de 2012 7:47
 
 16.04.2012 14:45, Claudio Valderrama C. wrote:
  Alex wrote ~0 instead of 0, did you notice it?
 
Oops, my fault. :(((

The strange case of Mr ~ and its tricks, trying to fool people.
(In the previous sentence, Jim would replace ~ by Bush.)

C.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-15 Thread Claudio Valderrama C.
 -Original Message-
 From: Dmitry Yemanov [mailto:firebi...@yandex.ru] 
 Sent: Sábado, 14 de Abril de 2012 1:26
 
 Claudio,
 
  Hello, for a long time I've been thinking in creating a 
 TxnType (or whatever
  name) to hold the type of a transaction, so it could be changed for
  experimentation in the future. This type would be ULONG for 
 now (although I
  found some cases where we still use SLONG).
 
 We have *a lot* of places where it's still SLONG. So I'd start with 
 making it globally unsigned.

Things get really interesting with code like this:

class RelationPages
{
public:
vcl*rel_pages;  // vector of pointer page
numbers
SLONG   rel_instance_id;// 0 or att_attachment_id or
tra_number

Attachment's id and related functions use SLONG and maybe they don't need
more, but the same var can contain tra id. And then

// global temporary relations attributes
RelationPages* getPages(thread_db* tdbb, SLONG tran = -1, bool allocPages =
true);

booldelPages(thread_db* tdbb, SLONG tran = -1,
RelationPages* aPages = 0);

Those functions use -1 to indicate a special condition.

I can attempt the change to unsigned, but I don't know if Firebird will
explode in flames.
;-)

C.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Transaction type

2012-04-13 Thread Dmitry Yemanov
Claudio,

 Hello, for a long time I've been thinking in creating a TxnType (or whatever
 name) to hold the type of a transaction, so it could be changed for
 experimentation in the future. This type would be ULONG for now (although I
 found some cases where we still use SLONG).

We have *a lot* of places where it's still SLONG. So I'd start with 
making it globally unsigned.

As for changing its type, this is still questionable. I'm playing with 
64-bit IDs for a while and I'm not yet confident this is the preferred 
approach for the future. I'd prefer to keep it as ULONG until we really 
know what we're going to do.


Dmitry

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel