V4MD : Connecting to a local DB AND to a server DB possible ?
Steven Ophalvens
silversoft at skynet.be
Tue Aug 14 07:45:04 CDT 2007
Hi Ruslan, thanks for your swift answer!
I switched to using only one Valentina object,
however the problem has not gone: when I Init()
the Valentina object, I can no longer succesfully open
the server database that I opened sucessfully before :
gVal = new( xtra "Valentina" )
gVal.initClient()--MacValSerial,WinValSerial
mDebug(gVal.lastErrorSymbol && " : initClient()")
gVal.Debuglevel =#kLogParams
gServerList = getServerList() -- This uses the locateBonjourService
mDebug(gVal.lastErrorSymbol &&" : getServerList()")
gConn = new(Xtra"VConnection", gServerList[1], lpServerLogin,
lpServerPass,15433, 5,ValServerPass)
mDebug(gVal.lastErrorSymbol &&" : gConn")
--
-- test 1
mDebug("test before Init()")
gConn.open()
mDebug(gVal.lastErrorSymbol &&" : gConn.Open()")
remote_db = new( Xtra "VDatabase", #kClient,gConn)
mDebug(gVal.lastErrorSymbol &&" : new VDatabase" )
remote_db.open("lpserver")
mDebug(gVal.lastErrorSymbol &&" : remote_db.open('lpserver')" )
remote_db.close()
mDebug(gVal.lastErrorSymbol &&" : remote_db.close()")
remote_db = void
gConn.close()
--
gVal.init(2*1024*1024, MacValSerial, WinValSerial)
mDebug(gVal.lastErrorSymbol &&" : gConn.Init()")
--
-- test 2
mDebug("test after Init()")
gConn.open()
mDebug(gVal.lastErrorSymbol &&" : gConn.Open()")
remote_db = new( Xtra "VDatabase", #kClient,gConn)
mDebug(gVal.lastErrorSymbol &&" : new VDatabase" )
remote_db.open("lpserver")
mDebug(gVal.lastErrorSymbol &&" : remote_db.open('lpserver')" )
remote_db.close()
mDebug(gVal.lastErrorSymbol &&" : remote_db.close()")
remote_db = void
gConn.close()
This outputs the following in the message window :
-- "145622260 :ERR_OK : initClient()"
* V4MD * : Valentina.locateBonjourService() ...
done
-- "145625306 :listOfServers : ERR_OK"
-- "145625312 :["steven-HP-vista._valentina._tcp.local."]"
-- "145625317 :ERR_OK : getServerList()"
* V4MD * : VConnection.new() ...
done
-- "145625356 :ERR_OK : gConn"
-- "145625362 :test before Init()"
* V4MD * : VConnection.open() ...
done
-- "145625385 :ERR_OK : gConn.Open()"
* V4MD * : new VDatabase ...
* V4MD * : VConnection.getImp() ...
done
done
-- "145625424 :ERR_OK : new VDatabase"
* V4MD * : VDatabase.open() ...
done
-- "145625441 :ERR_OK : remote_db.open('lpserver')"
* V4MD * : VDatabase.close() ...
done
-- "145625459 :ERR_OK : remote_db.close()"
* V4MD * : VDatabase_Destroy
...
done
* V4MD * : VConnection.close() ...
done
* V4MD * : Valentina.init() ...
done
-- "145625557 :ERR_OK : gConn.Init()"
-- "145625564 :test after Init()"
* V4MD * : VConnection.open() ...
done
-- "145625583 :ERR_OK : gConn.Open()"
* V4MD * : new VDatabase ...
* V4MD * : VConnection.getImp() ...
done
done
-- "145625610 :ERR_OK : new VDatabase"
* V4MD * : VDatabase.open() ...
ERROR: 533764
-- "145625630 :ERR_CONNECTION_INVALID_DATABASE_NAME :
remote_db.open('lpserver')"
* V4MD * : VDatabase.close() ...
done
-- "145625651 :ERR_OK : remote_db.close()"
* V4MD * : VDatabase_Destroy
...
done
* V4MD * : VConnection.close() ...
done
-----
And here is the relevant part of the VServer_Embedded.log :
14:29:39.807000 (5756): Connection established with '192.168.2.5:57774'
(680). ( Connections available: '4')
14:29:39.808000 (4148): I_Server get_Version is successful.
14:29:39.809000 (4148): (680) User: lpserver. Connection encoding: Latin-1
- LittleEndian.
14:29:39.847000 (2220): (680) Ping OK.
14:29:39.848000 (5756): (680) Database '(null)' remoteID 35103104
registered.
14:29:39.848000 (5756): (680) Database: <none>; User: lpserver: OK
14:29:39.849000 (4148): (680) I_Localizable 'nl_BE' put_IOEncoding is
successful.
14:29:39.866000 (2220): (680) Database 'lpserver' put_Location is
successfull.
14:29:39.866000 (2220): (680) Database '(null)' remoteID 35103104
unregistered.
14:29:39.866000 (2220): (680) Database 'lpserver.vdb' remoteID 35103104
registered.
14:29:39.866000 (2220): (680) Database 'lpserver' has been successfully
opened.
14:29:39.883000 (5756): (680) Database 'lpserver' has been successfully
closed.
14:29:39.896000 (4148): (680) Ping OK.
14:29:39.896000 (4148): (680) Database: lpserver; User: lpserver: OK
14:29:39.896000 (2220): (680) Database 'lpserver.vdb' remoteID 35103104
unregistered.
14:29:39.896000 (2220): (680) Closing database 'lpserver': OK
14:29:39.896000 (2220): (680) Database 'lpserver' has been successfully
destroyed.
14:29:39.927000 (5756): Closing connection (680). ( Connections available:
'5')
14:29:40.005000 (2220): Connection established with '192.168.2.5:57775'
(680). ( Connections available: '4')
14:29:40.005000 (5756): I_Server get_Version is successful.
14:29:40.007000 (4148): (680) User: lpserver. Connection encoding: Latin-1
- LittleEndian.
14:29:40.033000 (2220): (680) Ping OK.
14:29:40.034000 (5756): (680) Database '(null)' remoteID 35103104
registered.
14:29:40.034000 (5756): (680) Database: <none>; User: lpserver: OK
14:29:40.034000 (4148): (680) I_Localizable 'nl_BE' put_IOEncoding is
successful.
14:29:40.052000 (2220): (680) Database 'l' put_Location is successfull.
14:29:40.053000 (5756): (680) Database '(null)' remoteID 35103104
unregistered.
14:29:40.054000 (5756): (680) ERROR 0x82504: Invalid database name.
14:29:40.088000 (4148): (680) Ping OK.
14:29:40.088000 (4148): (680) Database: <none>; User: lpserver: OK
14:29:40.088000 (2220): (680) Database '(null)' remoteID 35103104
unregistered.
14:29:40.088000 (2220): (680) Closing database '(null)': OK
14:29:40.088000 (2220): (680) Database 'l' has been successfully destroyed.
14:29:40.152000 (5756): Closing connection (680). ( Connections available:
'5')
----
If I try to run the code without the gVal.Init() line, this code Works
perfect, but obviously I
can not connect to my local DB then.
If the error occured and I stop the project and restart it again (not
closing Director in between),
Director has a fatal error and I have to quit Director.
Thanks for any insights on this ! (I hope I am doing something wrong here)
Greetings,
Steven Ophalvens
-----Oorspronkelijk bericht-----
Van: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] Namens Ruslan Zasukhin
Verzonden: dinsdag 14 augustus 2007 7:23
Aan: valentina at lists.macserve.net
Onderwerp: Re: V4MD : Connecting to a local DB AND to a server DB possible ?
On 14/8/07 3:27 AM, "Steven Ophalvens" <silversoft at skynet.be> wrote:
> --------------------------------
> Well question 1:
>
> * have you made both
>
> Valentina.Init()
> Valentina.InitClient()
>
> ?
>
> -- Yes, I have made the Valentina.Init() call for the
> Local and the Valentina.InitClient() for the server
> DB.
> I have 2 Valentina Objects, one initialised for
> Client use, the other for local db use.
> Is it possible to have only one Valentina object that
> Runs both the Init() & InitClient()?
> If so, I'll try that tomorrow morning !
STOP.
I think this is not shown in examples.
Must be ONE Valentina object.
> --------------------------------
> Try set all LOG files ON.
> * VServer log VerbloseLevel = 3.
> * V4MD: Valentina.DebugLevel = ...
>
> -- Ok, I'll try that in the morning.
>
> --------------------------------
> Am I right that you use 2 different VDatabase objects to work with remote
> and local dbs?
>
> -- Yes, I even had 2 different Valentina objects, one for each vDatabase
> object
STOP.
I think this is not shown in examples.
Must be ONE Valentina object.
> --------------------------------
> What platform you are using?
>
> -- Vista Home Premium
Ok, should work. Few V4MD developers did work on Vista already.
--
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