Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Hilaire
Got it!

Hilaire

Le 22/02/2017 à 15:22, Esteban Lorenzano a écrit :
> I know, but I don’t know what it has or has not that version.

-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Esteban Lorenzano
I know, but I don’t know what it has or has not that version.

Esteban

> On 22 Feb 2017, at 15:15, Hilaire  wrote:
> 
> Here is the version I have, not sure it is the right way to get the
> version number:
> 
> ConfigurationOfVoyageMongo project currentVersion >=1.3.3
> [ConfigurationOfVoyageMongo]
> 
> Le 22/02/2017 à 15:02, Esteban Lorenzano a écrit :
>> and probably the version for Pharo 4 does not have the fix… I do not 
>> remember exactly where was the problem, let me review a bit...
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Hilaire
Here is the version I have, not sure it is the right way to get the
version number:

ConfigurationOfVoyageMongo project currentVersion >=1.3.3
[ConfigurationOfVoyageMongo]

Le 22/02/2017 à 15:02, Esteban Lorenzano a écrit :
> and probably the version for Pharo 4 does not have the fix… I do not remember 
> exactly where was the problem, let me review a bit...

-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Esteban Lorenzano
yep, that can be the problem: symbol/string incompatibilities

Esteban

> On 22 Feb 2017, at 15:05, Hilaire  wrote:
> 
> So far, I edited this method, adding a final string conversion:
> 
> voyageCollectionName
> "This method can be overridden with a more meaningful collection name"
> ^ (((self persistentClass name first: 3) allSatisfy: #isUppercase)
>   ifTrue: [ (self persistentClass name allButFirst: 2) ]
>   ifFalse: [ self persistentClass name ]) asString
> 
> 
> 
> Le 22/02/2017 à 15:02, Esteban Lorenzano a écrit :
>> yes, there was a bug around that, now I remember. 
>> and probably the version for Pharo 4 does not have the fix… I do not 
>> remember exactly where was the problem, let me review a bit...
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Hilaire
So far, I edited this method, adding a final string conversion:

voyageCollectionName
"This method can be overridden with a more meaningful collection name"
^ (((self persistentClass name first: 3) allSatisfy: #isUppercase)
ifTrue: [ (self persistentClass name allButFirst: 2) ]
ifFalse: [ self persistentClass name ]) asString



Le 22/02/2017 à 15:02, Esteban Lorenzano a écrit :
> yes, there was a bug around that, now I remember. 
> and probably the version for Pharo 4 does not have the fix… I do not remember 
> exactly where was the problem, let me review a bit...

-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Esteban Lorenzano
yes, there was a bug around that, now I remember. 
and probably the version for Pharo 4 does not have the fix… I do not remember 
exactly where was the problem, let me review a bit...

Esteban

> On 22 Feb 2017, at 14:51, Hilaire  wrote:
> 
> I though String may be problematic, so I try with Association.
> The problem still occurs at,
>   self collectionAt: anObject class inDatabase: db
> 
> There I can see at least a command failed error.
> The collection can't be added.
> 
> In addCollection: aString capped: aCapped size: aSize max: aMax, the
> reply from DB is:
> 
> a Dictionary('code'->15888 'errmsg'->'exception: must pass name of
> collection to create' 'ok'->0.0 )
> 
> Le 22/02/2017 à 14:40, Esteban Lorenzano a écrit :
>> no, but String probably will be complicated to persist “as is” (is not 
>> directly mappeable to a JSON/BSON object). Better to test with another 
>> object (like your original post).
>> we need to see what is the error you’re getting… the loop seems to be 
>> happening in a resignalAs: so there is an error somewhere (not that is good 
>> it resignal it instead showing it, but let’s go in parts :P)
>> 
>> Esteban
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Hilaire
It looks like the collection name by default is a symbol, and Mongo does
not like it.


In my example aString = #Association
A asString conversion seems to please it.


addCollection: aString capped: aCapped size: aSize max: aMax
| command reply |
command := SmallDictionary new.
command at: 'create' put: aString asString.


Regarding default voyageCollectionName, it indeeds return a Symbol.

Association voyageCollectionName. => #Association


By an extraordinatry circumstance, when apply to my domain object, it
returns a string, therefore I did not notice the problem before:

CGOrganisation voyageCollectionName. => 'Organisations'

Not sure it is the exact cause of the problem.

Hilaire


-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Hilaire
I though String may be problematic, so I try with Association.
The problem still occurs at,
self collectionAt: anObject class inDatabase: db

There I can see at least a command failed error.
The collection can't be added.

In addCollection: aString capped: aCapped size: aSize max: aMax, the
reply from DB is:

a Dictionary('code'->15888 'errmsg'->'exception: must pass name of
collection to create' 'ok'->0.0 )

Le 22/02/2017 à 14:40, Esteban Lorenzano a écrit :
> no, but String probably will be complicated to persist “as is” (is not 
> directly mappeable to a JSON/BSON object). Better to test with another object 
> (like your original post).
> we need to see what is the error you’re getting… the loop seems to be 
> happening in a resignalAs: so there is an error somewhere (not that is good 
> it resignal it instead showing it, but let’s go in parts :P)
> 
> Esteban

-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Esteban Lorenzano


> On 22 Feb 2017, at 14:36, Hilaire  wrote:
> 
> Yes, I marked the class String as voyage root. Should it be ByteArray?

no, but String probably will be complicated to persist “as is” (is not directly 
mappeable to a JSON/BSON object). Better to test with another object (like your 
original post).
we need to see what is the error you’re getting… the loop seems to be happening 
in a resignalAs: so there is an error somewhere (not that is good it resignal 
it instead showing it, but let’s go in parts :P)

Esteban

> 
> Hilaire
> 
> Le 22/02/2017 à 14:30, Esteban Lorenzano a écrit :
>> did you marked the class as “voyage root”?
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Hilaire
Yes, I marked the class String as voyage root. Should it be ByteArray?

Hilaire

Le 22/02/2017 à 14:30, Esteban Lorenzano a écrit :
> did you marked the class as “voyage root”?

-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Esteban Lorenzano
did you marked the class as “voyage root”?

Esteban

> On 22 Feb 2017, at 14:18, Hilaire  wrote:
> 
> Le 22/02/2017 à 12:18, Esteban Lorenzano a écrit :
>> that’s not enough information… where it hangs? (when you get the debugger 
>> after cmd+.)?
> 
> It looks like Voyage is trapped in a loop.
> When I execute the following code in singleton it hangs as well:
> 
> | orga repo|
> repo := VOMongoRepository host: 'localhost' database: 'MaBase'.
> repo enableSingleton.
> orga := String fromString: 'Pharo'.
> orga save.
> 
> Then I can press atl+., I got the attached Pharo debug log.
> 
> At some point I used wrongly Voyage, from there I got problem.
> 
> Thanks
> 
> Hilaire
> 
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 




Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Hilaire
Le 22/02/2017 à 12:18, Esteban Lorenzano a écrit :
> that’s not enough information… where it hangs? (when you get the debugger 
> after cmd+.)?

It looks like Voyage is trapped in a loop.
When I execute the following code in singleton it hangs as well:

| orga repo|
repo := VOMongoRepository host: 'localhost' database: 'MaBase'.
repo enableSingleton.
orga := String fromString: 'Pharo'.
orga save.

Then I can press atl+., I got the attached Pharo debug log.

At some point I used wrongly Voyage, from there I got problem.

Thanks

Hilaire


-- 
Dr. Geo
http://drgeo.eu
THERE_BE_DRAGONS_HERE
User Interrupt
22 Février 2017 2:14:11.47879 pm

VM: unix - i686 - linux-gnu - NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.20 uuid: cf2a-897d-48fd-8251-6789dd21d958 Jun 14 2014
NBCogit NativeBoost-CogPlugin-EstebanLorenzano.20 uuid: cf2a-897d-48fd-8251-6789dd21d958 Jun 14 2014
https://github.com/pharo-project/pharo-vm.git Commit: 0e8bbfbaeb03237fa6bb63ba834773fab18ca307 Date: 2014-06-14 12:20:21 -0300 By: Esteban Lorenzano  Jenkins build #14833

Image: Pharo4.0 [Latest update: #40627]

[ 
self schedule.	"It is critical that the following has no suspension point so that
	the test and the wait primitive are atomic. In addition, if the delay
	is no longer being waited on while entering the way we know that it 
	is expired because the delay has already fired."
beingWaitedOn
	ifTrue: [ delaySemaphore wait ]
	ifFalse: [ expired := true ] ] in DelayWaitTimeout>>wait
	Receiver: a DelayWaitTimeout(45000 msecs; 44974 msecs remaining)
	Arguments and temporary variables: 

	Receiver's instance variables: 
		delaySemaphore: 	a Semaphore()
		beingWaitedOn: 	true
		millisecondDelayDuration: 	45000
		scheduler: 	a DelayMicrosecondScheduler
		schedulerResumptionTime: 	3665222096453829
		process: 	a Process in [ 
self schedule.	"It is critical that the following has ...etc...
		expired: 	false


BlockClosure>>ensure:
	Receiver: [ 
self schedule.	"It is critical that the following has no suspension point so that
	the ...etc...
	Arguments and temporary variables: 
		aBlock: 	[ self unschedule ]
		complete: 	nil
		returnValue: 	nil
	Receiver's instance variables: 
		outerContext: 	DelayWaitTimeout>>wait
		startpc: 	41
		numArgs: 	0


DelayWaitTimeout>>wait
	Receiver: a DelayWaitTimeout(45000 msecs; 44970 msecs remaining)
	Arguments and temporary variables: 

	Receiver's instance variables: 
		delaySemaphore: 	a Semaphore()
		beingWaitedOn: 	true
		millisecondDelayDuration: 	45000
		scheduler: 	a DelayMicrosecondScheduler
		schedulerResumptionTime: 	3665222096453829
		process: 	a Process in [ 
self schedule.	"It is critical that the following has ...etc...
		expired: 	false


Semaphore>>waitTimeoutMSecs:
	Receiver: a Semaphore()
	Arguments and temporary variables: 
		anInteger: 	45000
		d: 	a DelayWaitTimeout(45000 msecs; 44967 msecs remaining)
	Receiver's instance variables: 
		firstLink: 	nil
		lastLink: 	nil
		excessSignals: 	0


Socket>>waitForConnectionFor:ifTimedOut:
	Receiver: a Socket[connected]
	Arguments and temporary variables: 
		timeout: 	45
		timeoutBlock: 	[ ConnectionTimedOut signal: 'Cannot connect to ' , (NetNameResol...etc...
		startTime: 	5930357
		msecsDelta: 	45000
		msecsEllapsed: 	0
		status: 	1
	Receiver's instance variables: 
		semaphore: 	a Semaphore()
		socketHandle: 	#[167 179 210 90 0 0 0 0 112 225 222 9]
		readSemaphore: 	a Semaphore()
		writeSemaphore: 	a Semaphore()


Socket>>connectTo:port:waitForConnectionFor:
	Receiver: a Socket[connected]
	Arguments and temporary variables: 
		hostAddress: 	#[127 0 0 1]
		port: 	27017
		timeout: 	45
	Receiver's instance variables: 
		semaphore: 	a Semaphore()
		socketHandle: 	#[167 179 210 90 0 0 0 0 112 225 222 9]
		readSemaphore: 	a Semaphore()
		writeSemaphore: 	a Semaphore()


SocketStream class>>openConnectionToHost:port:timeout:
	Receiver: SocketStream
	Arguments and temporary variables: 
		hostIP: 	#[127 0 0 1]
		portNumber: 	27017
		timeout: 	45
		socket: 	a Socket[connected]
	Receiver's instance variables: 
		superclass: 	Object
		methodDict: 	a MethodDictionary(#'<<'->SocketStream>>#'<<' #adjustInBuffer:->Soc...etc...
		format: 	154
		layout: 	a FixedLayout
		instanceVariables: 	#('recentlyRead' 'socket' 'inBuffer' 'outBuffer' 'inNextToWr...etc...
		organization: 	a ClassOrganization
		subclasses: 	nil
		name: 	#SocketStream
		classPool: 	a Dictionary()
		sharedPools: 	an OrderedCollection()
		environment: 	a SystemDictionary(lots of globals)
		category: 	#'Network-Kernel'
		traitComposition: 	{}
		localSelectors: 	nil


SocketStream class>>openConnectionToHost:port:
	Receiver: SocketStream
	Arguments and temporary variables: 
		hostIP: 	#[127 0 0 1]
		portNumber: 	27017
	Receiver's instance variables: 
		superclass: 	Object
		methodDict: 	a MethodDictionary(#'<<'->SocketStream>>#'<<' #adjustInBuffer:->Soc...etc...
		format: 	154
		layout: 	a FixedLayout
		instanceVariables: 	#('recentlyRead' 'socket' 'inBuffer' 'outBuffer' 'inNextToWr...etc...
	

Re: [Pharo-users] Voyage hang..

2017-02-22 Thread Esteban Lorenzano
Hi Hilaire, 

that’s not enough information… where it hangs? (when you get the debugger after 
cmd+.)?

Esteban

> On 21 Feb 2017, at 21:52, Hilaire  wrote:
> 
> Hi,
> 
> Trying to play with multiple repo, it occurs Voyage hangs the image with
> the script bellow:
> 
> | orga repo1 repo2|
> repo1 := VOMongoRepository host: 'localhost' database: 'test1'.
> repo2 := VOMongoRepository host: 'localhost' database: 'test2'.
> orga := CGOrganisation new name: 'Pharo'; id: 0; yourself.
> repo1 save: orga.
> repo2 save: (CGUser new id: 0; name: 'Hilaire'; organisation: orga;
> yourself).
> repo1 reset.
> repo2 reset.
> repo1 := repo2 := nil.
> repo1 := VOMongoRepository host: 'localhost' database: 'test1'.
> (repo1 selectAll: CGOrganisation) inspect.  "<- HANG here"
> 
> 
> The initial save is properly done in the MongoDB, I can see its content
> from the Mongo shell.
> 
> 
> Looking at the Mong log, there are connexion in and out:
> 
> Tue Feb 21 21:44:39.016 [conn508568] end connection 127.0.0.1:34469 (20
> connections now open)
> Tue Feb 21 21:44:39.016 [initandlisten] connection accepted from
> 127.0.0.1:34470 #508569 (21 connections now open)
> Tue Feb 21 21:44:39.016 [conn508569] end connection 127.0.0.1:34470 (20
> connections now open)
> Tue Feb 21 21:44:39.017 [initandlisten] connection accepted from
> 127.0.0.1:34471 #508570 (21 connections now open)
> Tue Feb 21 21:44:39.017 [conn508570] end connection 127.0.0.1:34471 (20
> connections now open)
> Tue Feb 21 21:44:39.017 [initandlisten] connection accepted from
> 127.0.0.1:34472 #508571 (21 connections now open)
> Tue Feb 21 21:44:39.018 [conn508571] end connection 127.0.0.1:34472 (20
> connections now open)
> Tue Feb 21 21:44:39.018 [initandlisten] connection accepted from
> 127.0.0.1:34473 #508572 (21 connections now open)
> Tue Feb 21 21:44:39.018 [conn508572] end connection 127.0.0.1:34473 (20
> connections now open)
> Tue Feb 21 21:44:39.018 [initandlisten] connection accepted from
> 127.0.0.1:34474 #508573 (21 connections now open)
> Tue Feb 21 21:44:39.019 [conn508573] end connection 127.0.0.1:34474 (20
> connections now open)
> 
> 
> Luckily, I can get back image control with Alt+[.]
> 
> What's wrong?
> 
> Thanks
> 
> Hilaire
> 
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
>