vstudio

Joakim Schramm joakim at astrocalc.com
Thu Dec 7 10:56:33 CST 2006


 Ruslan,

Can I ask you to please build new vstudio win asap? I have some problems in
my working sceenarion and first of all need to know if this is due to using
vstudio with newer VCOM kernel dll. It works better then before but still
some problems, but as the dll isn't "correct" there is no point in filing
bugs in Mantis or specific report problems here. So, just as soon as you can
get around to do it.

Regards,
Joakim

> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of 
> Ruslan Zasukhin
> Sent: 07 December 2006 09:58
> To: Charles Yeomans; valentina at lists.macserve.net
> Subject: Comment on code 
> 
> Hi Charles,
> 
> Your test project have this function.
> 
> -------------------------------------
> Sub Action()
>   dim connection as new VConnection("localhost", "sa", "sa")
>   connection.Open
>   dim db as new VDatabase(connection)
>   db.Open new FolderItem("pastefforts")
>   
>   dim c as VCursor = db.SQLSelect("SELECT recID, * FROM 
> Decisions WHERE recid < 400", EVCursorLocation.kServerSide, 
> EVLockType.kReadWrite,
> EVCursorDirection.kRandom)
>   
>   if c.FirstRecord then
>     do
>       if not c.BlobField("notesStyleData").IsNull then
>         dim styleData as String = 
> c.BlobField("notesStyleData").ReadRawData
>       end if
>     loop until not c.NextRecord
>   end if
>   c = nil
>   db.Close
>   
> exception oops
>   break
> ---------------------------------------------------------
> 
> 
> This code contains at least 2 not obvious mistakes.
> 
> 1) connection is never closed and destroyed.
> 
>     so when I try reproduce your few-clicks issue,
>     I simply get in server log that connections are eaten to zero,
>     and then server refuse connection.
> 
>     actually IT IS STRANGE that connection object not dies
>     on function exit. As I understand RB should kill 
> connection object.
>     right ?
> 
> 
> 2) this code is not safe from point of view of exception throw.
>     look.
> 
> If in loop any method will throw exception, then you will go 
> into last 2 lines of code. But lines
> 
>   c = nil
>   db.Close
>   connection.close
>   connection = nil 
> 
> Never will be executed. You see?
> 
> SAFE code must have such finalization code in both
>         
>         normal branch
>         exception branch
> 
> May be realbasic have like Java keyword:   'final' ?
> 
> 
> --
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list