michael.vancanneyt | 1 Dec 2011 10:03
Picon
Favicon

Re: CGI JSON RPC


On Wed, 30 Nov 2011, Dimitrios Chr. Ioannidis wrote:

> Hi all,
>
>  i surely need some help regarding the use of cgi with json rpc. I looked at 
> the demo1 example and tested it with testcgi app from the command line. All 
> was fine.  Then i tried to run the demo1 cgi app from apache with a php json 
> rpc client. It seems that i can't find the right uri to put into the php 
> call. All calls goes to the default action named 'manual'.
>
> I renamed the handler name from echo to myecho to resolve a conflict with the 
> php's function echo. The following code for calling the cgi working fine :
>
> <?php
>
> include('JsonRpcClient.php');
>
> $api = new JsonRpcClient('http://localhost/cgi-bin/demo.exe');
> print $api->myecho("Hello from JSON RPC");
>
> ?>

First of all, I doubt that the extension .exe is registered as a CGI app ?

What happens if you type this URL in the browser ?

I would suspect that you must rename the exe to a .cgi extension, but that
depends on your webserver setup.

(Continue reading)

Ludo Brands | 1 Dec 2011 10:17
Picon
Favicon

RE : SQLdb :: Commit, Rollback, etc.


> I can't keep a transaction (server locked) all the time.
> 

What database are you using that locks up the server when a transaction is
started?

Oracle for example starts an transaction as soon as you send an executable
SQL Statement. Opening a connection starts a transaction on the server.
Therefor it is important to match this behavior on the client side and force
the use of a TSQLTransaction. Using TADOConnection doesn't change this. ADO
is just hiding it from you.  

As long as you use a transaction level that is lower or equal to Read
committed, a transaction is almost at no cost to a database server (other
than access that doesn't support transactions or mysql that uses a different
backend to support transactions).

In a client server application, datasets are local copies of (a part of) the
database and should be short lived for tables that are updated regularly.
Re-opening (re-fetching) data from such tables after a commit or rollback is
almost a must to avoid the client working with old/wrong data. If you have
datasets linked to "low or no update" tables, attach them to a different
connection. 

Ludo

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@...
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
(Continue reading)

Marcos Douglas | 1 Dec 2011 13:07

Re: RE : SQLdb :: Commit, Rollback, etc.

On Thu, Dec 1, 2011 at 6:17 AM, Ludo Brands <ludo.brands@...> wrote:
>
>> I can't keep a transaction (server locked) all the time.
>>
>
> What database are you using that locks up the server when a transaction is
> started?

MS SQLServer 2008. Lock the registers, not the server... sorry.

> Oracle for example starts an transaction as soon as you send an executable
> SQL Statement. Opening a connection starts a transaction on the server.
> Therefor it is important to match this behavior on the client side and force
> the use of a TSQLTransaction. Using TADOConnection doesn't change this. ADO
> is just hiding it from you.

Ok, I can accept the TADOConnection can hiding a lot of things from
me, but I think it do open many transactions all the time.
Using SQLServer Profiler, I can see all SQL that are executing on the
server. So, I do not see BEGIN TRAN all the time, just when I call
BeginTrans.

> As long as you use a transaction level that is lower or equal to Read
> committed, a transaction is almost at no cost to a database server (other
> than access that doesn't support transactions or mysql that uses a different
> backend to support transactions).

I'm a tester of the new connector TMSSQLServer to SQLdb, by LacaK:
http://lazarus.freepascal.org/index.php/topic,15135.msg80922.html#msg80922

(Continue reading)

Ludo Brands | 1 Dec 2011 15:26
Picon
Favicon

RE : RE : SQLdb :: Commit, Rollback, etc.

> MS SQLServer 2008. Lock the registers, not the server... sorry.
> 
I guess you mean rows, pages or tables.

> Ok, I can accept the TADOConnection can hiding a lot of 
> things from me, but I think it do open many transactions all 
> the time. Using SQLServer Profiler, I can see all SQL that 
> are executing on the server. So, I do not see BEGIN TRAN all 
> the time, just when I call BeginTrans.
> 

That is because SQL server defaults to autocommit. A BEGIN TRANSACTION
starts an explicit transaction and disables the autocommit temporarely.

> I'm a tester of the new connector TMSSQLServer to SQLdb, by 
> LacaK: 
> http://lazarus.freepascal.org/index.php/topic,15135.msg80922.h
tml#msg80922

You can set the connection parameter AutoCommit=true when you want to
simulate ADO behavior. Unfortunately you have to set the parameter back to
false when starting an explicit transaction. Perhaps there should be an
easier way of doing this.

> If the component Open a Query I see BEGIN TRAN and... the 
> transaction isn't closed! Well, maybe there is a bug in the 
> new class by I see the SQLdb implementation and that class 
> follow the design.
>
> What I know is: "if a transaction is open, it's should be closed 
(Continue reading)

Marcos Douglas | 1 Dec 2011 17:49

Re: RE : RE : SQLdb :: Commit, Rollback, etc.

On Thu, Dec 1, 2011 at 11:26 AM, Ludo Brands <ludo.brands@...> wrote:
>> MS SQLServer 2008. Lock the registers, not the server... sorry.
>>
> I guess you mean rows, pages or tables.
>
>> Ok, I can accept the TADOConnection can hiding a lot of
>> things from me, but I think it do open many transactions all
>> the time. Using SQLServer Profiler, I can see all SQL that
>> are executing on the server. So, I do not see BEGIN TRAN all
>> the time, just when I call BeginTrans.
>>
>
> That is because SQL server defaults to autocommit. A BEGIN TRANSACTION
> starts an explicit transaction and disables the autocommit temporarely.
>
>> I'm a tester of the new connector TMSSQLServer to SQLdb, by
>> LacaK:
>> http://lazarus.freepascal.org/index.php/topic,15135.msg80922.h
> tml#msg80922
>
> You can set the connection parameter AutoCommit=true when you want to
> simulate ADO behavior. Unfortunately you have to set the parameter back to
> false when starting an explicit transaction. Perhaps there should be an
> easier way of doing this.

No, because I need to use REAL transactions.
As I said in forum:
If we use aParams (StartDBTransaction) we can do this very easy.
Again, see TIBConnection...
I can't modify Connection.Params (a global variable) many times. This
(Continue reading)

Mark Morgan Lloyd | 1 Dec 2011 19:48
Picon

WideString and TRegexpr

Has anybody with experience of WideStrings tried compiling the "new" 
Regexpr unit to support them?

I'm in a position where I could very much benefit from using these, but 
I think that I'm only seeing patterns match for characters <= #$00ff and 
even then am not seeing the match strings returned.

--

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@...
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Graeme Geldenhuys | 2 Dec 2011 15:44
Picon
Gravatar

fpGUI Toolkit v0.8 release for FPC 2.4.4 & 2.6.0-rc

Hi,

I'm glad to announce the next release of fpGUI Toolkit.

fpGUI v0.8
----------

An archived source download and pre-built binaries for DocView (fpGUI's
Documentation Viewer) can be found at the following URL:

  http://sourceforge.net/projects/fpgui/files/fpGUI/0.8/

...or clone the source code repository by using any of the following
commands:

  from SourceForge:
     git clone git://fpgui.git.sourceforge.net/gitroot/fpgui/fpgui

  from GitHub:
     git clone git://github.com/graemeg/fpGUI.git
   or
     git clone https://github.com/graemeg/fpGUI.git

Pre-built documentation in the highly optimized INF file format (for
use with DocView) is also available for download in a single archive,
just 1.7MB in side. The archive contains the fpGUI Toolkit API
documentation, and for your convenience, I also included the Free
Pascal Language Reference, FPC Runtime Library and the FPC Free
Component Library.

(Continue reading)

Frank Church | 2 Dec 2011 19:59
Picon

How to read TDOMNode attributes


Is there a way of knowning the attribute count of a TDOMNode as well as reading the value of an attribute if it exists?

--
Frank Church

=======================
http://devblog.brahmancreations.com
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@...
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Mattias Gaertner | 2 Dec 2011 20:09
Picon
Favicon

Re: How to read TDOMNode attributes

On Fri, 2 Dec 2011 18:59:25 +0000
Frank Church <vfclists@...> wrote:

> Is there a way of knowning the attribute count of a TDOMNode as well as
> reading the value of an attribute if it exists?

HasAttribute:=(Node is TDOMElement) and
(TDOMElement.hasAttribute('Name')); 

Attribute value:

if Node is TDOMElement then
  Value:=TDOMElement(Node).GetAttribute('Name')
else
  Value:='';

Mattias
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@...
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Frank Church | 2 Dec 2011 20:30
Picon

Re: How to read TDOMNode attributes



On 2 December 2011 19:09, Mattias Gaertner <nc-gaertnma-UIqTAjE4tzc5WgrkcBd8vg@public.gmane.org> wrote:
On Fri, 2 Dec 2011 18:59:25 +0000
Frank Church <vfclists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Is there a way of knowning the attribute count of a TDOMNode as well as
> reading the value of an attribute if it exists?

HasAttribute:=(Node is TDOMElement) and
(TDOMElement.hasAttribute('Name'));

Attribute value:

if Node is TDOMElement then
 Value:=TDOMElement(Node).GetAttribute('Name')
else
 Value:='';


Mattias
_______________________________________________
fpc-pascal maillist  -  fpc-pascal-PD4FTy7X32k2wBtHl531yWD2FQJk+8+b@public.gmane.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Is there a way of counting the attributes and listing them out if you don't know what they are in advance, or some kind of iteration which will tell you when you are on the last item or there are none at all?



--
Frank Church

=======================
http://devblog.brahmancreations.com
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@...
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Gmane