documentation and crashes

Michael Lee michaeljlee at comcast.net
Thu Nov 6 13:01:28 CST 2008


Hello Ruslan - Thanks for the prompt reply. I am using Director 10.1  
on a Mac, and VServer_Embedded with a DEMO license, which I  
downloaded from here: http://paradigmasoft.com/en/products/download/ 
EMBSRV

I do successfully run Embedded Server, and from Director I can now  
successfully open a database and send SQL commands to retrieve,  
modify, add, and delete records.

Here are a few examples of what I've had problems with, in no  
particular order:

The code examples in the Getting Started section of  
V4MD_Reference_3_en.pdf  have syntax errors.

In VStudio, if I disconnect a connection in Server Admin, VStudio  
crashes.

What is the difference between Separate and Solid in the Create New  
Table dialog in VStudio?  Is this explained anywhere?

It may be there, but I couldnt' find any real discussion about  
registering databases, so for a long time I didn't know it was  
required, and without registration, Director crashes.

The syntax for CREATE TABLE at the following URL appears to be wrong:
http://www.valentina-db.com/dokuwiki/doku.php? 
id=paradigma:public:en:documentation:vkernel:vlink:foreign_key

Activity Monitor claims that VServer_EMbedded is not responding.  
After scratching my head for a long time, I found a post in this list  
saying that this can be ignored, that the server is still running  
fine.  This might be something to add to the documents.

In this list you mention that to make SSL work correctly,   
"enableSSL=1" should appear in VServer_Embedded.ini. I dont' find  
mention of this anywhere else, and this variable doesn't appear in  
the default VServer_Embedded.ini.  Is it required?

The example AutoIncrement.dir works fine unless I set gSSLEnable to  
true. In this case, Director crashes when I Test Movie, every time.

Calling UseSSL in my project also crashes Director.  Below is  my  
code. If I set gSSLEnable to true, causing gConnection.UseSSL() to be  
called, Director crashes every time.

global Valentina
global vDb
global gClient
global gSSLEnable
global gConnection

on startMovie
   Valentina_Init
   vDB = openDatabase()
end

on stopMovie
   Valentina_Shutdown
end

on Valentina_Init
   clearGlobals()

   InitializeValentinaReferences()

   if( gClient ) then
     Valentina.InitClient( 10 )
     if CheckValError() then
       exit
     end if
   else
     Valentina.Init(8 * 1024 * 1024)
   end if

   if Valentina.cacheSize = 0 then
     alert ("Could not initialize Valentina. See V4MD_Log.txt file  
for errors")
     exit
   end if

   Valentina.debugLevel = #kLogParams -- set to #kLogNothing before  
release
   Valentina.logToMessageWindow = true
   Valentina.logToFile(true, true)  -- remove on release!
end

on InitializeValentinaReferences ()
   gClient = true
   -- To enable SSL set gSSLEnable to true
   gSSLEnable = false -- CAUSES CRASH IF TRUE!

   Valentina = new (Xtra("Valentina"))
   if not objectP(Valentina) then
     alert "Cannot set reference to Valentina Xtra!"
   end if
end


on openDatabase ()
   db = void
   if( gClient ) then

     if( gSSLEnable ) then thePort = 15435  -- this matches what is  
in VServer_Embedded.ini
     else  thePort = 15433  -- this matches what is in  
VServer_Embedded.ini

     gConnection = new(Xtra "VConnection", "localhost", "sa", "sa",  
thePort )
     if CheckValError() then exit -- No error, even if we can't  
connect! We don't get the error until we call Open below

     if( gSSLEnable ) then
       gConnection.UseSSL()
       if CheckValError() then exit
     end if

     gConnection.Open()
     if CheckValError() then exit

     --db = new VDatabase( gConnection )
     db = new(Xtra "VDatabase", #kClient, gConnection)
     if CheckValError() then exit

     -- server.RegisterDatabase( "test.vdb" )
     if CheckValError() then exit

     db.Open( "test.vdb" )
     if CheckValError() then exit

   else
     db = new(Xtra "VDatabase", #kLocal)
     if CheckValError() then exit

     db.Open( the moviepath & "test.vdb" )
     if CheckValError() then exit

   end if

   if(not objectP(db)) then
     alert("Cannot create VDatabase Xtra!")
   end if

   return db
end


on Valentina_Shutdown
   -- Clean up sample.
   if objectP(vDb) then
     vDb.close()
     --   vDb.throwOut()
     vDb = void
   end if

   if objectP(Valentina) then
     -- When we finish work with Valentina engine we should shutdown it.
     if( gClient ) then
       if objectP(gConnection) then
         gConnection.Close()
       end if

       Valentina.shutDownClient()
     else
       Valentina.shutDown()
     end if
   end if

   Valentina = void
end


on CheckValError ()

   if objectP(Valentina) then
     if ( Valentina.lastError <> 0 ) then
       alert "ERROR: " & Valentina.lastErrorSymbol & "(" &  
Valentina.lastErrorString & ")"
       return 1
     else
       return 0
     end if
   end if

end



More information about the Valentina mailing list