RemoteEventCounts in FbRemoteEvent

View: New views
19 Messages — Rating Filter:   Alert me  

RemoteEventCounts in FbRemoteEvent

by paha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jiri, i have one question:

It seems like handling of RemoteEventCounts-Event of the FbRemoteEvent class occurs in other than calling thread. It means, accessing some outside objects inside FbRemoteEventEventHandler is not thread safe (and this fact is not obvious). Can you consider it as Feature Request - raising FbRemoteEventEventHandler event in calling thread context? I could try to make a patch on the Weekend (but i must look into the code first, to find out, if i can do it myself).  

Re: Re moteEventCounts in FbRemoteEvent

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 18, 2008 at 5:11 PM, paha <ch_pasha@...> wrote:
> It seems like handling of RemoteEventCounts-Event of the FbRemoteEvent class
> occurs in other than calling thread. It means, accessing some outside

You mean the callback?

> objects inside FbRemoteEventEventHandler is not thread safe (and this fact
> is not obvious). Can you consider it as Feature Request - raising
> FbRemoteEventEventHandler event in calling thread context? I could try to
> make a patch on the Weekend (but i must look into the code first, to find
> out, if i can do it myself).

I have no problem with it.

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Re moteEventCounts in FbRemoteEvent

by paha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jiri, so I managed it faster as supposed. The original problem: Suppose we have following code in for instance Windows Forms window.
public Form1()
        {
            InitializeComponent();


            FbConnection conn = new FbConnection("some connection");
            conn.Open();
            FbRemoteEvent remoteEvent = new FbRemoteEvent(conn);
            remoteEvent.AddEvents(new[] {"TEST"});
            remoteEvent.RemoteEventCounts += new FbRemoteEventEventHandler(remoteEvent_RemoteEventCounts);
            remoteEvent.QueueEvents();
            int id = Thread.CurrentThread.ManagedThreadId; //Here we'll have value for instance 10
        }

        void remoteEvent_RemoteEventCounts(object sender, FbRemoteEventEventArgs e)
        {
            //Here we are, when event fires
            int id = Thread.CurrentThread.ManagedThreadId; //this value will be different from value obtained in Form1 constructor
            bool v = this.InvokeRequired; //Expression is true, that means if somebody writes here something
                                                    //like this.textBox1.Text = e.Counts.ToString()
                                                    //there will be Exception about accessing UI from another Thread 
        }

My patch should address this issue so that objects of the spawning thread can be safely accessed from event handler. Could you test it and commit if you find it useful? Regards, Pavel.FbRemoteEvent.patch

(no subject)

by Pham Huu Le quoc phuc-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I downloaded Provider 2.1, I found somes problems:
1. variable shouldDisposeSelectCommand in FbDataAdapter class not assign anywhere but
it's used.
2. FBScript constructor with parameter filename, I think should has contructor with
script input. I build a web service program, client program read file and send script
to server, I use FBScript class to update into DB.
3. Function: RemoveComments(string source) of Fbscrip should change from private to
public.

Thanks

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: (no subject)

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jul 19, 2008 at 4:40 AM, Pham Huu Le quoc phuc
<phucphlq@...> wrote:
> I downloaded Provider 2.1, I found somes problems:
> 1. variable shouldDisposeSelectCommand in FbDataAdapter class not assign anywhere but
> it's used.

Look at line 147.

> 2. FBScript constructor with parameter filename, I think should has contructor with
> script input. I build a web service program, client program read file and send script
> to server, I use FBScript class to update into DB.

There's a ctor with TextReader param.

> 3. Function: RemoveComments(string source) of Fbscrip should change from private to
> public.

Reason?

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Error on building manually FB Provider

by Mercea Paul :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I try to build manually FB provider from
NETProvider\build\win32\ado.net\build.bat
but I get error in build.log:

      [csc]
d:\ProjectsCVS\FireBird\NETProvider\trunk\NETProvider\source\FirebirdSql\Dat
a\Common\Charset.cs(25,14): error CS0234: The type or namespace name 'Linq'
does not exist in the namespace 'System' (are you missing an assembly
reference?)

Should be an #if (NET_35 && ENTITY_FRAMEWORK) for this?
#if (NET_35 && ENTITY_FRAMEWORK)

using System.Linq;

#endif


Best regards,
Paul




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Error on building manually FB Provider

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Jul 20, 2008 at 9:58 PM, Mercea Paul <paul.mercea@...> wrote:
> Hi
>
> I try to build manually FB provider from
> NETProvider\build\win32\ado.net\build.bat
> but I get error in build.log:

First, the NAnt build scripts are not maintained. At least not continuosly.

>      [csc]
> d:\ProjectsCVS\FireBird\NETProvider\trunk\NETProvider\source\FirebirdSql\Dat
> a\Common\Charset.cs(25,14): error CS0234: The type or namespace name 'Linq'
> does not exist in the namespace 'System' (are you missing an assembly
> reference?)
>
> Should be an #if (NET_35 && ENTITY_FRAMEWORK) for this?

No, it's not EF related. You just have to use C#3.0 (to understand
lambda) compiler on FW3.5 (to have extension methods for IEnumerable),
which is current development platform. These extension methods are
just syntax sugar, so it doesn't affect FW2.0 run.

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Error on building manually FB Provider

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

BTW look at thread "2.5.0.0 provider and framework 3.5". There's my
brief description of 2.0 vs 3.5 future development.

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Some questions?

by Pham Huu Le quoc phuc-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



-----Original Message-----
From: firebird-net-provider-bounces@...
[mailto:firebird-net-provider-bounces@...] On Behalf Of
Jiri Cincura
Sent: Saturday, July 19, 2008 15:31
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] (no subject)

On Sat, Jul 19, 2008 at 4:40 AM, Pham Huu Le quoc phuc
<phucphlq@...> wrote:
> I downloaded Provider 2.1, I found somes problems:
> 1. variable shouldDisposeSelectCommand in FbDataAdapter class not assign
anywhere but
> it's used.

Look at line 147.

> 2. FBScript constructor with parameter filename, I think should has
contructor with
> script input. I build a web service program, client program read file and
send script
> to server, I use FBScript class to update into DB.

There's a ctor with TextReader param.

I write a client - server program. At client, user select a script sql file,
my program read and send script to server. At server, I want new FbScript
with ctor parameter is script(not TextReader). I can't pass TextReader to
server.

> 3. Function: RemoveComments(string source) of Fbscrip should change from
private to
> public.

I want remove commmends on script without init FbScript
Reason?

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: (no subject)

by Pham Huu Le quoc phuc-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When I compile from source, it has warning, shouldDisposeSelectCommand is
assigned anywhere.


www.tonyvn.com

-----Original Message-----
From: firebird-net-provider-bounces@...
[mailto:firebird-net-provider-bounces@...] On Behalf Of
Jiri Cincura
Sent: Saturday, July 19, 2008 15:31
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] (no subject)

On Sat, Jul 19, 2008 at 4:40 AM, Pham Huu Le quoc phuc
<phucphlq@...> wrote:
> I downloaded Provider 2.1, I found somes problems:
> 1. variable shouldDisposeSelectCommand in FbDataAdapter class not assign
anywhere but
> it's used.

Look at line 147.

> 2. FBScript constructor with parameter filename, I think should has
contructor with
> script input. I build a web service program, client program read file and
send script
> to server, I use FBScript class to update into DB.

There's a ctor with TextReader param.

> 3. Function: RemoveComments(string source) of Fbscrip should change from
private to
> public.

Reason?

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Some questions?

by Dean Harding :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pham Huu Le Quoc Phuc wrote:
> There's a ctor with TextReader param.
>
> I write a client - server program. At client, user select a script sql file,
> my program read and send script to server. At server, I want new FbScript
> with ctor parameter is script(not TextReader). I can't pass TextReader to
> server.

Um, you need to look up the documentation for TextReader. It's exactly
what you are after.

>
>> 3. Function: RemoveComments(string source) of Fbscrip should change from
> private to
>> public.
>
> I want remove commmends on script without init FbScript
> Reason?

The source code for FbScript is available, if you need your own version,
just use it. You can't make every method public just because someone,
somewhere, might one day want it. You'd be creating a maintenance
nightmare for yourself.

Dean.

>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Some questions?

by Pham Huu Le quoc phuc-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank for your reply,
Please tell me more TextReader?


www.tonyvn.com


-----Original Message-----
From: firebird-net-provider-bounces@...
[mailto:firebird-net-provider-bounces@...] On Behalf Of
Dean Harding
Sent: Wednesday, July 23, 2008 13:24
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Some questions?

Pham Huu Le Quoc Phuc wrote:
> There's a ctor with TextReader param.
>
> I write a client - server program. At client, user select a script sql
file,
> my program read and send script to server. At server, I want new FbScript
> with ctor parameter is script(not TextReader). I can't pass TextReader to
> server.

Um, you need to look up the documentation for TextReader. It's exactly
what you are after.

>
>> 3. Function: RemoveComments(string source) of Fbscrip should change from
> private to
>> public.
>
> I want remove commmends on script without init FbScript
> Reason?

The source code for FbScript is available, if you need your own version,
just use it. You can't make every method public just because someone,
somewhere, might one day want it. You'd be creating a maintenance
nightmare for yourself.

Dean.

>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Some questions?

by Carlos Guzmán Álvarez ™ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello:

I write a client - server program. At client, user select a script sql file,
my program read and send script to server. At server, I want new FbScript
with ctor parameter is script(not TextReader). I can't pass TextReader to
server.

Are you sending it as a String ?? if yes, what prevents you to create the TextReader in the server ??
 
I want remove commmends on script without init FbScript

That method should remain as it's right now IMHO xD

 

--
Carlos Guzmán Álvarez
Vigo-Spain

http://carlosga.wordpress.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Some questions?

by Dean Harding :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pham Huu Le Quoc Phuc wrote:
> Thank for your reply,
> Please tell me more TextReader?

http://msdn.microsoft.com/en-us/library/system.io.textreader.aspx

And, specifically for your case:

http://msdn.microsoft.com/en-us/library/system.io.stringreader.aspx

Dean.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: (no subject)

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 23, 2008 at 8:18 AM, Pham Huu Le Quoc Phuc
<phucphlq@...> wrote:
> When I compile from source, it has warning, shouldDisposeSelectCommand is
> assigned anywhere.

http://firebird.svn.sourceforge.net/svnroot/firebird/NETProvider/trunk/NETProvider/source/FirebirdSql/Data/FirebirdClient/FbDataAdapter.cs

        public FbDataAdapter(string selectCommandText, FbConnection
selectConnection)
            : base()
        {
            this.SelectCommand = new FbCommand(selectCommandText,
selectConnection);
            this.shouldDisposeSelectCommand = true;
        }

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Some questions?

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 23, 2008 at 8:10 AM, Pham Huu Le Quoc Phuc
<phucphlq@...> wrote:
> I want remove commmends on script without init FbScript

The FbScript isn't general purpose parser for working with scripts.
It's created for running statements from scripts, without any parsing
the script yourself.

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Re moteEventCounts in FbRemoteEvent

by Jiri Cincura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

can you post this into tracker. Thanks.

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Re: Re moteEventCounts in FbRemoteEvent

by paha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jiri Cincura wrote:
Hello,
can you post this into tracker. Thanks.
Me? I mean, we have discussed here so many things besides FbRemoteEvent