Re: [lazarus] status of development

2006-04-19 Thread Florian Klaempfl
Alain Michaud wrote:
 Ok, then  what about that score:
 
 hello world1 %
   GTK   98 %
   GTK2  90 %
   Win32 99 %
   QT10 %
 
 Right now Laz/linux comes with GTK by default. I supose that we will do
 a transition to GTK2 (or QT) at some point. Are we? When and how is that
 going to hapen?
 
 This is just a naive question in order to understand better what is
 going on. I like GTK very much but I know that it is being replaced by
 GTK2 also that QT is very good. I am just  a simple user and I will use
 anything that works well and is open source pascal. I do not know much
 about those matters and would like to read your comments. 

I don't think that lazarus will ever use Qt by default because it requires a
separate license (rather expensive) if you development non GPL applications.
 
 Alain
 
 In Linux we thrust
 
 
  
 
 On Tue, 2006-04-18 at 22:14 +0200, Micha Nelissen wrote:
 On Tue, 18 Apr 2006 15:57:30 -0400
 Alain Michaud [EMAIL PROTECTED] wrote:

 What is the status of development of the various widgetsets?

 Let's assume that 100 % will be the level of a stable version and 50 %
 is the level required for a simple hello world application. Would that
 Hmm, 50% for hello world is not realistic. Getting a hello world to work is
 *very* easy. I mean it! :-). Getting all the details with button clicks,
 mouse moving, keyboard presses/releasing, menus, painting, and all that
 working well takes a *lot* of time. I'd say hello world is more like 0.5%
 or so. If you got lazarus and the examples running, and looking somewhat
 ok, then you're like 20-25% of the way. As always in software development,
 the final perfections take the most time ;-). But it's also only then,
 that the real value, the beauty, appears.

 Micha

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
 
 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Micha Nelissen

Joost van der Sluis wrote:

Is this a problem with PostrgreSQL itself or the component in lazarus
wrapping it?


It's a problem of postgres. A transaction 'block' is started with the
sql-command 'begin', from that comand on, all queries are executed


But you can do multiple queries in a block I suppose ? Multiple update, 
and one select, or so ?


Micha

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] status of development

2006-04-19 Thread Micha Nelissen

Florian Klaempfl wrote:

Alain Michaud wrote:

Ok, then  what about that score:

hello world1 %
  GTK   98 %
  GTK2  90 %
  Win32 99 %
  QT10 %


Yes, forgot to say in the other mail, but these numbers are about right; 
although I think gtk2 is not that far yet (90%), as the lazarus IDE does 
not run on gtk2 AFAIK. Some painting things are also very slow, which 
needs to be improved. We don't have a 'dedicated' gtk2 developer at this 
point, although some submit a patch now and then.



Right now Laz/linux comes with GTK by default. I supose that we will do
a transition to GTK2 (or QT) at some point. Are we? When and how is that
going to hapen?


Yes, we will transition to gtk2 at some point, but only after 1.0. Now 
as to the question when 1.0 will arrive, I can't really say: bugs are 
being reported like mad, some of them blocking 1.0, others not.



This is just a naive question in order to understand better what is
going on. I like GTK very much but I know that it is being replaced by
GTK2 also that QT is very good. I am just  a simple user and I will use


I don't think that lazarus will ever use Qt by default because it requires a
separate license (rather expensive) if you development non GPL applications.


Not necessarily, we could distribute a Qt Lazarus for KDE oriented 
distros, but that builds gtk, gtk2, or qt apps, whatever you want. There 
is no requirement that the widgetset lazarus is built with equals the 
one you use to build apps with.


Micha

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] status of development

2006-04-19 Thread Vincent Snijders

Micha Nelissen schreef:

Florian Klaempfl wrote:

Alain Michaud wrote:

Ok, then  what about that score:

hello world1 %
  GTK   98 %
  GTK2  90 %
  Win32 99 %
  QT10 %


Yes, forgot to say in the other mail, but these numbers are about right; 
although I think gtk2 is not that far yet (90%), as the lazarus IDE does 
not run on gtk2 AFAIK. Some painting things are also very slow, which 
needs to be improved. We don't have a 'dedicated' gtk2 developer at this 
point, although some submit a patch now and then.


If
- 100% means ready for 1.0
- 30% is a running Lazarus
- 50% means 50% of development time of a stable version
then my estimates are as follows.

GTK: 90 %
GTK2: 60 %
Win32: 85 %
QT: 5 %

Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Growing memory and MySQL

2006-04-19 Thread Sainty
- Original Message - 
From: Michael Van Canneyt [EMAIL PROTECTED]

To: lazarus@miraclec.com
Cc: Sainty [EMAIL PROTECTED]
Sent: Thursday, April 06, 2006 11:15 PM
Subject: Re: [lazarus] Growing memory and MySQL





On Thu, 6 Apr 2006, Vincent Snijders wrote:


Sainty wrote:
 Hello all,

 I'd like to know what I'm doing wrong (certainly I'm doing something
 wrong). Here is a problem described:

 - I have an OnTimer event (TTimer component) defined like this:

 begin
 MySQLQuery.SQL.Text := 'SELECT CVSKEY FROM CVS WHERE CVSCID=1';
 MySQLQuery.Open;
 CallID := MySQLQuery.Fields[0].AsInteger;
 MySQLQuery.Close;
 end;

 The interval of TTimer is 2000ms. My problem is that after 12 hours of
 working my application memory usage is very high (over 100MB). What
 should I free on each interval? Is there a better way to do that kind
 of
 select to MySQL db?

 Thanks in advance,


I don't know the internals, but saw this patch recently applied to fpc
2.1.1:
http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/fcl/db/sqldb/mysql/mysqlconn.inc?rev=3149sortby=dateview=diffr1=3149r2=3148p1=trunk/fcl/db/sqldb/mysql/mysqlconn.incp2=/trunk/fcl/db/sqldb/mysql/mysqlconn.inc

Maybe this can explain the behavior you are seeing.


There was a resource leak in mysqlconn, which I too encountered recently.
Joost has fixed it.

Michael.


Hello again,

I've tested my application again with win32 snapshot from 18-04-2006, which
already contain fixed resource leak described

http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/fcl/db/sqldb/mysql/mysqlconn.inc?rev=3149sortby=dateview=diffr1=3149r2=3148p1=trunk/fcl/db/sqldb/mysql/mysqlconn.incp2=/trunk/fcl/db/sqldb/mysql/mysqlconn.inc

but I still have got the same problem with growing memory. I'm not sure if
I'm doing everything ok. For fast investigation I've prepared some demo
project with mysql and ttimer, you can download it at:
http://www.wsisiz.edu.pl/~zaleski/mysql_ttimer.zip (~600KB)

thanks in advance,

Sainty



--
Poznaj Stefana! Zmien komunikator!  http://link.interia.pl/f1924

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Michael Van Canneyt



On Wed, 19 Apr 2006, Adrian Maier wrote:


On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:

Is this a problem with PostrgreSQL itself or the component in lazarus
wrapping it?


It's a problem of postgres. A transaction 'block' is started with the
sql-command 'begin', from that comand on, all queries are executed
within that transaction. Using another connection is not possible.
Unless, offcourse, you start a new connection. Or closes the transaction
(commit, rollback etc)


Please pardon me for jumping in the middle of the thread, but your
phrase made me really curious.   The behaviour you described seems
to be the normal one, once you execute begin (transaction) . What
other behaviour would someone expect postgres to have ?


To allow several concurrent transactions.

Interbase/Firebird allows to start several concurrent transactions in
1 connection. AFAIK Oracle and MS-SQL too (named transactions).

This is extremely handy.

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Michael Van Canneyt



On Wed, 19 Apr 2006, Micha Nelissen wrote:


Joost van der Sluis wrote:

Is this a problem with PostrgreSQL itself or the component in lazarus
wrapping it?


It's a problem of postgres. A transaction 'block' is started with the
sql-command 'begin', from that comand on, all queries are executed


But you can do multiple queries in a block I suppose ? Multiple update, and 
one select, or so ?


Obviously, this is the whole idea of transactions ? :)

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Micha Nelissen

Michael Van Canneyt wrote:
But you can do multiple queries in a block I suppose ? Multiple 
update, and one select, or so ?


Obviously, this is the whole idea of transactions ? :)


Then I don't see why multiple concurrent transactions are useful ? The 
user can only do one thing at a time anyway, right? :-)


Micha

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Michael Van Canneyt



On Wed, 19 Apr 2006, Micha Nelissen wrote:


Michael Van Canneyt wrote:
But you can do multiple queries in a block I suppose ? Multiple update, 
and one select, or so ?


Obviously, this is the whole idea of transactions ? :)


Then I don't see why multiple concurrent transactions are useful ? The user 
can only do one thing at a time anyway, right? :-)


Didn't you implement threads ? ;-)

Not if you make e.g. some reports in the background, using threads.

For server apps, multiple transactions in a connection are a must.

My apps at work depend on it: one connection to the database, and at least
1 transaction per user...

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Micha Nelissen

Michael Van Canneyt wrote:
Then I don't see why multiple concurrent transactions are useful ? The 
user can only do one thing at a time anyway, right? :-)


Didn't you implement threads ? ;-)

Not if you make e.g. some reports in the background, using threads.


Hmm I didn't expect multiple transactions on one connection to be thread 
safe.



For server apps, multiple transactions in a connection are a must.

My apps at work depend on it: one connection to the database, and at least
1 transaction per user...


The 'middle' tier, you mean ? Why is the single connection a must ?

Micha

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] wince interfaces patch

2006-04-19 Thread roozbeh gholizadeh


This patch fixes some bugs,button captions are working now,tstatictext is  
also working!

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

mypatch.patch
Description: Binary data


[lazarus] Re: wince interfaces patch

2006-04-19 Thread roozbeh gholizadeh
On Wed, 19 Apr 2006 12:37:36 +0330, roozbeh gholizadeh  
[EMAIL PROTECTED] wrote:




This patch fixes some bugs,button captions are working now,tstatictext is
also working!


well  saw other peaple pasted patch in text message so here it is again


Index: wincecallback.inc
===
--- wincecallback.inc   (revision 9144)
+++ wincecallback.inc   (working copy)
@@ -863,14 +863,15 @@
 End;
 WM_CLOSE:
 Begin
-  if (Window = TWinCEWidgetSet(WidgetSet).AppHandle) and
-(Application.MainForm  nil) then
+//  if (Window = TWinCEWidgetSet(WidgetSet).AppHandle) and
+//(Application.MainForm  nil) then
   begin
+Windows.SendMessage(Application.MainForm.Handle, WM_CLOSE, 0, 0);
 Application.Terminate;
-//Windows.SendMessage(Application.MainForm.Handle, WM_CLOSE, 0,  
0);

-  end else begin
-LMessage.Msg := LM_CLOSEQUERY;
   end;
+//  else begin
+//LMessage.Msg := LM_CLOSEQUERY;
+//  end;
   // default is to destroy window, inhibit
   WinProcess := false;
 End;
Index: winceint.pp
===
--- winceint.pp (revision 9144)
+++ winceint.pp (working copy)
@@ -152,6 +152,7 @@
 Procedure AttachMenuToWindow(AMenuObject: TComponent); override;
 procedure AppRun(const ALoop: TApplicationMainLoop); override;

+
 // create and destroy
 function CreateComponent(Sender : TObject): THandle; override;
 function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc) :  
integer; override;

@@ -218,7 +219,7 @@
 // WinCEWSGrids,
 // WinCEWSImgList,
 // WinCEWSMaskEdit,
-// WinCEWSMenus,
+// WinCEWSMenus,//roozbeh:not yet ready for use!
 // WinCEWSPairSplitter,
 // WinCEWSSpin,
  WinCEWSStdCtrls,
Index: winceobject.inc
===
--- winceobject.inc (revision 9144)
+++ winceobject.inc (working copy)
@@ -195,8 +195,18 @@
 end;

 procedure TWinCEWidgetSet.AttachMenuToWindow(AMenuObject: TComponent);
+var
+  AMenu: TMenu;
+  AWinControl: TWinControl;
 begin
-  inherited AttachMenuToWindow(AMenuObject);
+  AMenu := AMenuObject as TMenu;
+  if AMenu is TMainMenu then
+  begin
+AWinControl := TWinControl(AMenu.Owner);
+//roozbeh this is somehow very difficut to achieve for now!
+//Windows.SetMenu(AWinControl.Handle, AMenu.Handle);
+AddToChangedMenus(AWinControl.Handle);
+  end;
 end;

 function TWinCEWidgetSet.CreateComponent(Sender: TObject): THandle;
Index: winceproc.pp
===
--- winceproc.pp(revision 9144)
+++ winceproc.pp(working copy)
@@ -63,6 +63,14 @@
 procedure DisableApplicationWindows(Window: HWND);
 procedure EnableApplicationWindows(Window: HWND);

+procedure AddToChangedMenus(Window: HWnd);
+
+//roozbeh:this thing belong to windows unit...someone should move them  
there!
+function GetTextExtentPoint(DC: HDC; Str: PWideChar; Count: Integer; var  
Size: TSize): BOOL;
+function GetTextExtentPoint32(DC: HDC; Str: PWideChar; Count: Integer;  
var Size: TSize): BOOL;

+function SysAllocStringLen(psz:pointer;len:dword):pointer;
+procedure SysFreeString(bstr:pointer);
+
 type
   PDisableWindowsInfo = ^TDisableWindowsInfo;
   TDisableWindowsInfo = record
@@ -72,14 +80,26 @@

 var
   DefaultWindowInfo: TWindowInfo;
+  ChangedMenus: TList; // list of HWNDs which menus needs to be redrawn

+
 implementation

 uses
   SysUtils, LCLStrConsts, Dialogs, StdCtrls, ExtCtrls,
   LCLIntf; //remove this unit when GetWindowSize is moved to TWSWinControl

-//roozbeh:should these be here?why not in windows or...?
+function GetTextExtentPoint(DC: HDC; Str: PWideChar; Count: Integer; var  
Size: TSize): BOOL;

+begin
+Windows.GetTextExtentExPoint(dc, Str, Count, 0, nil, nil, @Size);
+end;
+
+function GetTextExtentPoint32(DC: HDC; Str: PWideChar; Count: Integer;  
var Size: TSize): BOOL;

+begin
+GetTextExtentPoint(dc, Str, Count, Size);
+end;
+
+
 function SysAllocStringLen(psz:pointer;len:dword):pointer;stdcall;
  external 'oleaut32.dll' name 'SysAllocStringLen';

@@ -605,6 +625,36 @@
   end;
 end;

+
+{---
+  procedure AddToChangedMenus(Window: HWnd);
+
+  Adds Window to the list of windows which need to redraw the main menu.
+---}
+procedure AddToChangedMenus(Window: HWnd);
+begin
+  if ChangedMenus.IndexOf(Pointer(Window)) = -1 then // Window handle is  
not yet in the list

+ChangedMenus.Add(Pointer(Window));
+end;
+
+{--
+  Method: RedrawMenus
+  Params:  None
+  Returns: Nothing
+
+  Redraws all changed menus
+ 
--}
+{procedure RedrawMenus;
+var
+  I: 

Re: [lazarus] Re: wince interfaces patch

2006-04-19 Thread Micha Nelissen

roozbeh gholizadeh wrote:
On Wed, 19 Apr 2006 12:37:36 +0330, roozbeh gholizadeh 
[EMAIL PROTECTED] wrote:



This patch fixes some bugs,button captions are working now,tstatictext is
also working!


well  saw other peaple pasted patch in text message so here it is again


As attachment is preferred, because now long lines will be wrapped, but 
you specified in your first mail (the mime type):


Content-Type: application/octet-stream; name=mypatch.patch

That's why we/you can't read it in the message and need to save it 
first. Use text/plain for plain text files.


Micha

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Joost van der Sluis
On Tue, 2006-04-18 at 14:27 -0700, johnf wrote:
 On Tuesday 18 April 2006 13:42, Marc Santhoff wrote:
  Am Dienstag, den 18.04.2006, 21:29 +0200 schrieb Joost van der Sluis:
   On Tue, 2006-04-18 at 14:43 -0400, Alexandre Leclerc wrote:
2006/4/18, Joost van der Sluis [EMAIL PROTECTED]:
 But you can have one connection, whith several transactions bound
  
   to it.
  
 PostgreSQL doesn't support that, but SQLdb handles that for you,
  
   it
  
 creates new connection internally automatically.
   
Do you mean TPQConnection does not support many TSQLTransaction?
  
   'But you can have one connection, whith several transactions bound to
   it.'
  
   So you can.
  
   Only PostgreSQL can't, so SQLDdb handles it.
 
  May I ask:
 
  Is this a problem with PostrgreSQL itself or the component in lazarus
  wrapping it?
 
  I'm planning to use PG in the near future, but this may influence my
  decision ...
 
  TIA,
  Marc
 
 I can't answer your question directly.  But I can provide a little 
 information 
 about what I have added to this discussion.  First let me say that I have 
 always used only one connection to a database engine and controlled all of my 
 transactions in code in the past (just to let you know where I'm coming 
 from).  But with FPC I was not able to use just one connection to the 
 database.  

There's a difference between 'FPC can't' and 'PostgreSQL can't'
Since FPC can do this, but postgresql can't. So sqldb hides the creation
of a second connection to the database.

If that doesn't work, it's a bug.

But in the case of postgres you should not think of connections. In
reality, it has no connections, it only has transactions! You open a
transaction to the database...

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Joost van der Sluis
On Wed, 2006-04-19 at 09:22 +0200, Micha Nelissen wrote:

 But you can do multiple queries in a block I suppose ? Multiple
 update, 
 and one select, or so ?

Yes, you can even do multiple selects. But what you can't do is rollback
only a part of the block. (well.. there are safepoints, but not
important for this example)
And you can't isolate the different select statements within one block.

JoJo,
  Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Joost van der Sluis
On Wed, 2006-04-19 at 10:22 +0300, Adrian Maier wrote:
 On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:
   Is this a problem with PostrgreSQL itself or the component in lazarus
   wrapping it?
 
  It's a problem of postgres. A transaction 'block' is started with the
  sql-command 'begin', from that comand on, all queries are executed
  within that transaction. Using another connection is not possible.
  Unless, offcourse, you start a new connection. Or closes the transaction
  (commit, rollback etc)
 
 Please pardon me for jumping in the middle of the thread, but your
 phrase made me really curious.   The behaviour you described seems
 to be the normal one, once you execute begin (transaction) . What
 other behaviour would someone expect postgres to have ?

Several other databases have support for more then one transaction. This
means that if you want to execute a query, you have to tell in which
transaction the query should be executed. There are no real standard
sql-commands for this, but consider something like this:

connect;
begin trans1;
begin trans2;
trans1: select * from tbl1;
trans1: insert into tbl1(str) values ('Welcome');
trans2: select * from tbl1;
commit trans1;
trans2: select * from tbl1;
commit trans2;
disconnect;

This code will never show the just inserted value 'welcome'. (Default
isolation-level)

Since the insert that is done in transaction1, isn't visible for
transaction2.

Postgres doesn't support multiple transactions in one connection. So you
have to use two connections. But further it's the same.

JoJo,
  Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Adrian Maier
On 4/19/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:
 On Wed, 19 Apr 2006, Adrian Maier wrote:

  On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:
  Is this a problem with PostrgreSQL itself or the component in lazarus
  wrapping it?
 
  It's a problem of postgres. A transaction 'block' is started with the
  sql-command 'begin', from that comand on, all queries are executed
  within that transaction. Using another connection is not possible.
  Unless, offcourse, you start a new connection. Or closes the transaction
  (commit, rollback etc)
 
  Please pardon me for jumping in the middle of the thread, but your
  phrase made me really curious.   The behaviour you described seems
  to be the normal one, once you execute begin (transaction) . What
  other behaviour would someone expect postgres to have ?

 To allow several concurrent transactions.

Is this implemented inside the database engine, as some special SQL
commands ?   Is it possible to start more transactions simultaneously
from firebird's interactive utility?how does one specify that a certain
SQL command has to be executed inside one transaction or another  ?

 Interbase/Firebird allows to start several concurrent transactions in
 1 connection. AFAIK Oracle and MS-SQL too (named transactions).

I'm not sure about this.
Oracle has named transactions, but those are just labels that are given
to long-running transaction - so that they can be easier identified. Also,
in Oracle it is possible that a stored procedure be executed in an
'autonomous' transaction ( i've used this once for writing a procedure
that wrote debugging information to a table ; in case of error the messages
would have been rolled back unless they were inserted by an autonomous
transaction).  But i believe that these autonomous transactions are a different
beast from the feature we are talking about.


 This is extremely handy.

I understand this.
Yet,  my feeling is that this feature is an interbase/firebird
extension , and that
it would be possible to achieve the same by using more standard features like
cursors and savepoints.


Adrian Maier

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Michael Van Canneyt



On Wed, 19 Apr 2006, Adrian Maier wrote:


On 4/19/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:

On Wed, 19 Apr 2006, Adrian Maier wrote:


On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:

Is this a problem with PostrgreSQL itself or the component in lazarus
wrapping it?


It's a problem of postgres. A transaction 'block' is started with the
sql-command 'begin', from that comand on, all queries are executed
within that transaction. Using another connection is not possible.
Unless, offcourse, you start a new connection. Or closes the transaction
(commit, rollback etc)


Please pardon me for jumping in the middle of the thread, but your
phrase made me really curious.   The behaviour you described seems
to be the normal one, once you execute begin (transaction) . What
other behaviour would someone expect postgres to have ?


To allow several concurrent transactions.


Is this implemented inside the database engine, as some special SQL
commands ?


Yes.

SET TRANSACTION



Is it possible to start more transactions simultaneously
from firebird's interactive utility?


Yes.


how does one specify that a certain
SQL command has to be executed inside one transaction or another  ?


SELECT TRANSACTION NAME XYZ




Interbase/Firebird allows to start several concurrent transactions in
1 connection. AFAIK Oracle and MS-SQL too (named transactions).


I'm not sure about this.
Oracle has named transactions, but those are just labels that are given
to long-running transaction - so that they can be easier identified. Also,
in Oracle it is possible that a stored procedure be executed in an
'autonomous' transaction ( i've used this once for writing a procedure
that wrote debugging information to a table ; in case of error the messages
would have been rolled back unless they were inserted by an autonomous
transaction).  But i believe that these autonomous transactions are a different
beast from the feature we are talking about.


Probably it's a restricted form. Like I said, I'm not sure about oracle
and MS-SQL...






This is extremely handy.


I understand this.
Yet,  my feeling is that this feature is an interbase/firebird
extension , and that
it would be possible to achieve the same by using more standard features like
cursors and savepoints.


Interbase has those too, but you can't do what I need with that:
In a server app, have 1 connection and several independent transactions
within that connection.

You must take into account that most commercial engines require a per-user
license, so connections are 'expensive'. 1 connection with separate
transactions solves this problem. There is 1 connection, but each user
is in a separate transaction...

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Joost van der Sluis
On Wed, 2006-04-19 at 13:22 +0300, Adrian Maier wrote:
 On 4/19/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:
  On Wed, 19 Apr 2006, Adrian Maier wrote:
 
   On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:
   Is this a problem with PostrgreSQL itself or the component in lazarus
   wrapping it?
  
   It's a problem of postgres. A transaction 'block' is started with the
   sql-command 'begin', from that comand on, all queries are executed
   within that transaction. Using another connection is not possible.
   Unless, offcourse, you start a new connection. Or closes the transaction
   (commit, rollback etc)
  
   Please pardon me for jumping in the middle of the thread, but your
   phrase made me really curious.   The behaviour you described seems
   to be the normal one, once you execute begin (transaction) . What
   other behaviour would someone expect postgres to have ?
 
  To allow several concurrent transactions.
 
 Is this implemented inside the database engine, as some special SQL
 commands ?   Is it possible to start more transactions simultaneously
 from firebird's interactive utility?how does one specify that a 
 certain
 SQL command has to be executed inside one transaction or another  ?
  Interbase/Firebird allows to start several concurrent transactions in
  1 connection. AFAIK Oracle and MS-SQL too (named transactions).
 
 I'm not sure about this.
 Oracle has named transactions, but those are just labels that are given
 to long-running transaction - so that they can be easier identified. Also,
 in Oracle it is possible that a stored procedure be executed in an
 'autonomous' transaction ( i've used this once for writing a procedure
 that wrote debugging information to a table ; in case of error the messages
 would have been rolled back unless they were inserted by an autonomous
 transaction).  But i believe that these autonomous transactions are a 
 different
 beast from the feature we are talking about.

Oracle's transactions are the most flexible. You can do the same thing
with them as with the Firebird transactions, and far more.

If you use the C-api to execute a query, you have to/can provide the
transaction in which the query should get executed. 

I don't know if that could also be done with SQL-statements, or which
statements that should be.

JoJo,
  Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Joost van der Sluis
On Wed, 2006-04-19 at 13:36 +0300, Adrian Maier wrote:
 On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:
  Several other databases have support for more then one transaction. This
  means that if you want to execute a query, you have to tell in which
  transaction the query should be executed. There are no real standard
  sql-commands for this, but consider something like this:
 
 The one thing that is unclear for me is how do you specify in which
 transaction you wish to execute a particular command.
 
  connect;
  begin trans1;
  begin trans2;
 
  trans1: select * from tbl1;
 
 Is this some kind of pseudocode, or are you saying that
 trans1: select * from tbl1;  is valid SQL syntax ?

No, pseudo-code, see Michaels mail for the real commands.

  trans1: insert into tbl1(str) values ('Welcome');
  trans2: select * from tbl1;
  commit trans1;
  trans2: select * from tbl1;
  commit trans2;
  disconnect;
 
  This code will never show the just inserted value 'welcome'. (Default
  isolation-level)
 
  Since the insert that is done in transaction1, isn't visible for
  transaction2.
 
 Indeed, it's not visible.  Therefore: the same user can see that record
 in one place, and at the same time he doesn't see the record in another
 place. Is this truly a good thing ?

No. I would use one transaction for one user.
Or you can decide to use one transaction for each form, or one for each
thread. That's all up to the developer.

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread Adrian Maier
On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:

 No, pseudo-code, see Michaels mail for the real commands.

Yep, I've seen them.   Interesting. It's good to know about them .

  Indeed, it's not visible.  Therefore: the same user can see that record
  in one place, and at the same time he doesn't see the record in another
  place. Is this truly a good thing ?

 No. I would use one transaction for one user.
This happens in a middle-tier application, i guess.

 Or you can decide to use one transaction for each form, or one for each
 thread. That's all up to the developer.

I see.

Just a last note (maybe this is useful for someone):
When using postgresql and there are too many users, it is possible to use
connection polling  :   http://pgpool.projects.postgresql.org/


Adrian Maier

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] FPC question

2006-04-19 Thread johnf
On Wednesday 19 April 2006 04:57, Adrian Maier wrote:
 On 4/19/06, Joost van der Sluis [EMAIL PROTECTED] wrote:
  No, pseudo-code, see Michaels mail for the real commands.

 Yep, I've seen them.   Interesting. It's good to know about them .

   Indeed, it's not visible.  Therefore: the same user can see that record
   in one place, and at the same time he doesn't see the record in another
   place. Is this truly a good thing ?
 
  No. I would use one transaction for one user.

 This happens in a middle-tier application, i guess.

  Or you can decide to use one transaction for each form, or one for each
  thread. That's all up to the developer.

 I see.

 Just a last note (maybe this is useful for someone):
 When using postgresql and there are too many users, it is possible to use
 connection polling  :   http://pgpool.projects.postgresql.org/


 Adrian Maier

Since I believe I'm the guy that started this thread I think I'll take the 
time to explain in more detail how and why I started the thread.  

In the app I want to develop I would like the user to be able to have open 
several forms at once.  As an example I could open the customer form several 
times and each form would be independent of each other.  Each customer form 
could do lookups, change data etc.  You see examples of what I'm describing 
in accounting programs.  I started out attempting to use a data module.  The 
data module solution sort of worked (although I would crash for unknown 
reasons) but required that the transaction control be opened and closed often 
as I moved from form to form and from action to action (selects, updates, 
deletes, inserts).  Controlling a single transaction control from each form 
was a pain.  So why not have a number of transactions available – one for 
each form.  That's when I discovered that one connection would not allow 
multiple transaction.  You see I was leaving the transaction active.  When I 
opened a second form and attempted to select any data I'd get the error 
stating that I had an open transaction.  This started me thinking why does 
this limitation exist?  So I started asking questions.  Shouldn't each 
transaction have it's own session.  Why is it that when I do a read (select) 
I must have a transaction open (a begin is sent to the database engine).  In 
the end I have been told that it is a limitation of Postgres not SQLdb.  So 
in the end I choose to use a new connection for each form.  I guess the real 
reason I questioned all of this was because I did not have any such 
limitation when using Foxpro to connect to Postgres.  I could make all the 
reads I wanted without having to start a transaction.  But I was forced to 
control updates, inserts, and deletes within transactions.  

Yes I understand that I could write a Unit that contains a routine to handle 
my reads:
procedure GetSqlData(parameter myquery);
Open the transaction;
Make the select; 
Close the transaction;

And the above started more questions.  When I started experimenting with the 
call I noticed that my code size got larger.  I would have thought just the 
reverse would have occurred.  I became concerned when I realized that I was 
passing objects as parameters.  So then I asked the question about how the 
compiler handled the call.  Which is why this thread is labeled “FPC 
question”.  I was concerned that I had missed a compiler switch or was doing 
it wrong.  In the end I have no answer.  The size of the bin is not that 
large (I have about 8 forms and code = approx. 15.1 megs) and it seems to run 
fast with calling a central routine or just having a connection for each 
form.  Programming is a lot easier when I just add a connection for each 
form.  But then I open lots of connections.  Postgres can handle thousands of 
connections with little overhead.  So why worry – be happy to coin a song.

John

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Lazarus and OCX

2006-04-19 Thread juanmime
Hello,

I'm porting an old Delphi application to Lazarus. This application, needs
to embeed a PDF viewer in its interface.

I did it with an OCX provided by Adobe, that I imported to Delphi's component
palette. Delphi allowes me to iclude an OCX as a normal Delphi's component.

Is there any way to incorporate an OCX as an Lazarus component ? If not,
how can I include and instanciate an OCX component to a Lazarus Forms ? Anybody
can help me ?

Thanks.


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQL DB access functional?

2006-04-19 Thread Jon Foster






Joost van der Sluis wrote:

  
[...] With PostgreSQL it blows when I try to go up
records in a grid instead of going down. Probably has more to do with
I was going up from a newly inserted record.

  
  
Yes, it was probably a bug in TBufDataset, which is used for all
connection-types. Try to use fpc 2.1.1, the svn-version. There this bug
should be fixed (in fact, it's rewritten). You can find pre-compiled
snapshots on the lazarus website.
  

This seems to have fixed that issue.

  
  
  
In MySQL i never get to a run stage it dies in the IDE when I try to
activate the query component.

  
  
That's a different issue, if this problem remains with 2.1.1, please let
me know.
  

Actually with the new FPC I now have the components described in the
MySQL Database document on the wiki. So instead of having one component
I have three versioned ones. After I guessed the right component to use
I have been able to successfully connect. 

One thing that might be helpful is if the there was someway of denoting
the client library version instead of the MySQL server version
(libmysqlclient.so.10 = v10, libmysqlclient.so.12 = v12). My reasoning
is that the MySQL component used has to match the installed client lib
and not necessarily the server version. This is a frequent problem for
me because I have situations where there are multiple MySQL servers
running different versions of MySQL on the network and the client libs
are typically installed to match the software being used. This is also
a problem with using a notebook and traveling from site to site.


  It's pretty to work with Firebird, yes. Never tried FB 2.0 with sqldb
before, though. But it's unlikely that they changed the API like MySQL
does, so I don't expect any issues.
  

I'm not sure I like its size. In its default install ps reports its
sucking up ~50mb of ram. MySQL and ProstgreSQL are way lighter. It
might be config thing though. Haven't given up on it yet.

On another note: I've seen some strange behavior with the DB grid. I
have a table with 3 records in it. In the IDE I see all three. When I
run the application I see two until I go to insert a new record then
the grid repopulates with all three and the new row for a fourth.

Lastly: After new records are inserted on a grid is there something I
have to do to get them to post to the database? They aren't being
added. Kylix required that I post the transaction.

THX - Jon

-- 
Jon Foster
JF Possibilities, Inc.
[EMAIL PROTECTED]
541-410-2760
Making computers work for you!




_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQL DB access functional?

2006-04-19 Thread johnf
transaction.commit
John
On Wednesday 19 April 2006 09:23, Jon Foster wrote:
  Joost van der Sluis wrote:
 [...] With PostgreSQL it blows when I try to go up
 records in a grid instead of going down. Probably has more to do with
 I was going up from a newly inserted record.

 Yes, it was probably a bug in TBufDataset, which is used for all
 connection-types. Try to use fpc 2.1.1, the svn-version. There this bug
 should be fixed (in fact, it's rewritten). You can find pre-compiled
 snapshots on the lazarus website.

  This seems to have fixed that issue.


 In MySQL i never get to a run stage it dies in the IDE when I try to
 activate the query component.

 That's a different issue, if this problem remains with 2.1.1, please let
 me know.

  Actually with the new FPC I now have the components described in the MySQL
 Database document on the wiki. So instead of having one component I have
 three versioned ones. After I guessed the right component to use I have
 been able to successfully connect.

  One thing that might be helpful is if the there was someway of denoting
 the client library version instead of the MySQL server version
 (libmysqlclient.so.10 = v10, libmysqlclient.so.12 = v12). My reasoning is
 that the MySQL component used has to match the installed client lib and not
 necessarily the server version. This is a frequent problem for me because I
 have situations where there are multiple MySQL servers running different
 versions of MySQL on the network and the client libs are typically
 installed to match the software being used. This is also a problem with
 using a notebook and traveling from site to site.


 It's pretty to work with Firebird, yes. Never tried FB 2.0 with sqldb
 before, though. But it's unlikely that they changed the API like MySQL
 does, so I don't expect any issues.

  I'm not sure I like its size. In its default install ps reports its
 sucking up ~50mb of ram. MySQL and ProstgreSQL are way lighter. It might be
 config thing though. Haven't given up on it yet.

  On another note: I've seen some strange behavior with the DB grid. I have
 a table with 3 records in it. In the IDE I see all three. When I run the
 application I see two until I go to insert a new record then the grid
 repopulates with all three and the new row for a fourth.

  Lastly: After new records are inserted on a grid is there something I have
 to do to get them to post to the database? They aren't being added. Kylix
 required that I post the transaction.

  THX - Jon

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus and OCX

2006-04-19 Thread Christian U.

Lazarus dont support OCX´s as components since they are not cross platform.
the best way is you use an external pdf2html converter and show this with 
turboipro or something else.
2nd way is you load your ocx with windows ole api prvided by freepascal (i 
hope) 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Building revision 9144

2006-04-19 Thread Luc

Vincent Snijders a écrit :

Luc Vigato wrote:

Hello,

I have problem after building lazarus rev 9144, I can't start 
lazarus. I compile with interface GTK2. Before i have had the same 
problem with GTK interface.


Has anyone an idea in how i can help you with this ?


I assume you are using fpc 2.0.2 or fpc 2.0.3 on x86_64-linux. If this 
is correct, you might see the consequences of fpc bug 5010: 
http://www.freepascal.org/bugs/showrec.php3?ID=5010


Vincent.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives



Yes, i'm using fpc 2.0.2 on x86_64-linux.

The solution is using  fpc 2.1.1 ?



Luc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Lazarus and OCX

2006-04-19 Thread Marc Santhoff
Am Mittwoch, den 19.04.2006, 16:35 +0200 schrieb [EMAIL PROTECTED]:
 Hello,
 
 I'm porting an old Delphi application to Lazarus. This application, needs
 to embeed a PDF viewer in its interface.
 
 I did it with an OCX provided by Adobe, that I imported to Delphi's component
 palette. Delphi allowes me to iclude an OCX as a normal Delphi's component.
 
 Is there any way to incorporate an OCX as an Lazarus component ? If not,
 how can I include and instanciate an OCX component to a Lazarus Forms ? 
 Anybody
 can help me ?

I can't name one, but there are several print preview components in
the wild. If you combine one with powerpdf (see lazarus wiki
downloads) that could build a nice pdf viewer component ...

HTH,
Marc


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Building revision 9144

2006-04-19 Thread Vincent Snijders

Luc wrote:

Vincent Snijders a écrit :


Luc Vigato wrote:


Hello,

I have problem after building lazarus rev 9144, I can't start 
lazarus. I compile with interface GTK2. Before i have had the same 
problem with GTK interface.


Has anyone an idea in how i can help you with this ?



I assume you are using fpc 2.0.2 or fpc 2.0.3 on x86_64-linux. If this 
is correct, you might see the consequences of fpc bug 5010: 
http://www.freepascal.org/bugs/showrec.php3?ID=5010




Yes, i'm using fpc 2.0.2 on x86_64-linux.

The solution is using  fpc 2.1.1 ?


I am not sure that is going to work either, see lazarus bug reports 1971 
and 1972.


Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Fwd: Idea for a Lazarus project

2006-04-19 Thread A.J. Venter
Just thought I would shared the views in this message - well done guys :)

A.J.
-- Forwarded message --
From: Chris Rorden [EMAIL PROTECTED]
Date: Apr 19, 2006 12:15 AM
Subject: Re: Idea for a Lazarus project
To: [EMAIL PROTECTED]


A.J.-

Just to say that the conversion of my software from Delphi to Lazarus
went smoothly, and the graphics double-buffering seems effective. I
have only compiled to Windows (I am using SUSE, so I think I will wait
for the next release of Lazarus before compiling the Linux version).

I have posted my Lazarus source code as well as a list of outstanding
problems onto a web page
 http://www.sph.sc.edu/comd/rorden/mricron/source.html
and placed a note on the Lazarus forum to see if other people want to
eradicate the remaining issues. I must say I was really impressed with
Lazarus - the Delphi-Lazarus port is much easier than Delphi-Kylix.

-chris


--
Semper in excretum set alta variant - My father
A.J. Venter - http://www.silentcoder.co.za

---

-- 
there's nothing as inspirational for a hacker as a cat obscuring a bug 
by sitting in front of the monitor - Boudewijn Rempt
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives