[Firebird-net-provider] Expanding mapping abilities for EF

2009-12-30 Thread Jiri Cincura
Hi *,

I was thinking about supporting broader variety of datatypes (from
.NET) in EF for mapping. We already had a request for direct guid
support and since beginning we have (manual) support for bools.
Unfortunately neither of these is available directly in FB, hence
there's set of standard workarounds like char(16) octets for guid.

And as we started supporting features not available in FB directly
through autoincrement field via #PK_GEN# in comment, I would like to
propose similar way for bool and guid. I don't like the way of
guessing - char(16) octets = guid etc. It may work in 99 percent
cases but, sooner or later you hit the wall with bad guess. So my
propose is to override the datatype of column reported by provider
for EF by two new magic keywords. For guids it'll be #GUID# and for
bools #BOOL#.

What I'm not sure about is whether do check for the datatype as well.
Like smallint  #BOOL# is bool, but timestamp  #BOOL# is still
timestamp. I'm more for blindly using the comment and leave the
thinking to developer. Why? Because for i.e. bool you can have
smallint, int, bigint and maybe decimal if you're brave enough. For
guids with triggers and views maybe some crazy types. This shouldn't
create any hidden places with potential error. As if the thinking will
be wrong with first let's say insert you'll get an error. But that's
only my view.

Any comments, thoughts?

-- 
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.cincura.net/ | http://www.ID3renamer.com

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Expanding mapping abilities for EF

2009-12-30 Thread Daniel Rail
Hi,

At December-30-09, 2:40 PM, Jiri Cincura wrote:

 Hi *,

 I was thinking about supporting broader variety of datatypes (from
 .NET) in EF for mapping. We already had a request for direct guid
 support and since beginning we have (manual) support for bools.
 Unfortunately neither of these is available directly in FB, hence
 there's set of standard workarounds like char(16) octets for guid.

 And as we started supporting features not available in FB directly
 through autoincrement field via #PK_GEN# in comment, I would like to
 propose similar way for bool and guid. I don't like the way of
 guessing - char(16) octets = guid etc. It may work in 99 percent
 cases but, sooner or later you hit the wall with bad guess. So my
 propose is to override the datatype of column reported by provider
 for EF by two new magic keywords. For guids it'll be #GUID# and for
 bools #BOOL#.

 What I'm not sure about is whether do check for the datatype as well.
 Like smallint  #BOOL# is bool, but timestamp  #BOOL# is still
 timestamp. I'm more for blindly using the comment and leave the
 thinking to developer. Why? Because for i.e. bool you can have
 smallint, int, bigint and maybe decimal if you're brave enough. For
 guids with triggers and views maybe some crazy types. This shouldn't
 create any hidden places with potential error. As if the thinking will
 be wrong with first let's say insert you'll get an error. But that's
 only my view.

 Any comments, thoughts?


What happens if someone uses another type for bools? As an example, I
usually use CHAR(1) with the values T and F. If it can be
configurable, with a default of SMALLINT, it would be even better.
And, I could almost say the same for GUIDs, as some might be storing
them in a VARCHAR(32), in another charset than OCTET. I currently use
ECO and the GUID field is stored in a VARCHAR(32) UTF-8 field.

And, don't try to automatically map to those types, because it's
possible that someone uses a SMALLINT field as an actual SMALLINT, not
a boolean.  I could probably say the same for CHAR(16) OCTET, as you
might be suspecting for that other 1%, where the assumption might be
wrong.

I would suggest, if it's possible, to simply give a warning to the
developer that #BOOL# and TIMESTAMP don't match, but still let the
developer use that combination.  And, if an error occurs in runtime,
then the developer will realize that it wont work.

-- 
Best regards,
 Daniel Rail
 Senior Software Developer
 ACCRA Solutions Inc. (www.accra.ca)
 ACCRA Med Software Inc. (www.filopto.com)


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


[Firebird-net-provider] Problems with firebird .net provider on mono

2009-12-30 Thread João Dias de Carvalho Neto
Hi,

I had problems in connection with Firebird 2.1 and the Provider on Mono.

When the FbConnection.Open() method was called, one exception was raised:

Unhandled Exception: System.TypeInitializationException: An exception was
thrown by the type initializer for FirebirdSql.Data.Common.Charset ---
System.ArgumentException: Encoding name 'shift_jis' not supported
Parameter name: name
  at System.Text.Encoding.GetEncoding (System.String name) [0x0]
  at FirebirdSql.Data.Common.Charset.GetEncoding () [0x0]
  at FirebirdSql.Data.Common.Charset..ctor (Int32 id, System.String name,
Int32 bytesPerCharacter, System.String systemName) [0x0]
  at FirebirdSql.Data.Common.Charset.InitializeSupportedCharsets ()
[0x0]
  at FirebirdSql.Data.Common.Charset..cctor () [0x0]
  --- End of inner exception stack trace ---
  at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect ()
[0x0]
  at (wrapper remoting-invoke-with-check)
FirebirdSql.Data.FirebirdClient.FbConnectionInternal:Connect ()
  at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create () [0x0]
  at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut () [0x0]
  at (wrapper remoting-invoke-with-check)
FirebirdSql.Data.FirebirdClient.FbConnectionPool:CheckOut ()
  at FirebirdSql.Data.FirebirdClient.FbConnection.Open () [0x0]

My connection string is:

Database=/home/harpia/data/hapiadados.fdb;Server=127.0.0.1;Dialect=3;Password=masterkey;Port=3050;User=SYSDBA;Charset=Win1252;

I had searching on web and I find something on this link

http://www.mail-archive.com/firebird-net-provider@lists.sourceforge.net/msg06892.html

Jiri answered on this link, that mono isn't supporting the referent charset
(UNICODE_FSS), but I would like to use Win1252

It is possible using Mono?

I try too:

1

To Donwload Mono's specific Firebird .Net Provider on this link
http://sourceforge.net/projects/firebird/files/firebird-net-provider/2.5.1/FirebirdClient-2.5.1-MONO_LINUX.7z/download

To install the assembly with gacutil command

To reference the assembly on my project

2

To Donwload the Firebird .Net provider's source

To Compile it with LINUX;MONO compiler directives on MonoDevelop (Like
Jiri suggested previously)

To reference the assembly on my project.

all my tries are failed! :-(

In the first try, the same exception persists. In the second try I could not
compile the source, cause one Compiling Time Exception was raised that looks
like a casting error

[Task:File=/home/jdias/Área de
Trabalho/NETProvider/source/FirebirdSql/Data/Client/Managed/Version10/GdsStatement.cs,
Line=731, Column=95, Type=Error, Priority=Normal, Description=Can not
compute type of conditional expression as `short' and `int' convert
implicitly to each other(CS0172)]

Please, someone can help me with this?

Where I can donwload an functional assembly to work on mono using Charset
Win1252?

Thanks for any help and sorry the bad English


-- 
João Dias de Carvalho Neto

http://www.jdiasneto.blogspot.com
jdias.bjsoftw...@gmail.com
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev ___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider