Re: [Pharo-users] Glorp + P3 + SQLite

2019-11-21 Thread Pavel Krivanek
Hi Todd,

we want to do some more testing before merging it into the upstream
repository.

-- Pavel

čt 21. 11. 2019 v 14:34 odesílatel Todd Blanchard via Pharo-users <
pharo-users@lists.pharo.org> napsal:

> Hi Pavel,
>
> I've just gotten around to figuring out BaslineOf and packages.  I see
> this work is in a branch on your own repository.
>
> Do you plan to do a pull request back to the original repository?  I feel
> like we have database code all over the place and no clear "official"
> versions.
>
> Stll trying to figure out what is current and what is obsolete (Garage?)
>
> On Oct 19, 2019, at 5:18 AM, Pavel Krivanek 
> wrote:
>
> Btw. there exists an updated version of Glorp:
> github://pavel-krivanek/glorp:8.3.1-23-baseline
> But the compatibility of it with SQLite was never tested
>
> -- Pavel
>
> so 19. 10. 2019 v 10:27 odesílatel Todd Blanchard via Pharo-users <
> pharo-users@lists.pharo.org> napsal:
>
>> I loaded GLORP+P3 without issue.
>>
>> Trying to load SQLite3 - it also wants to load GLORP which complains of
>> conflict.
>>
>> For P3 I used:
>>
>> Metacello new
>>baseline: 'P3';
>>repository: 'github://svenvc/P3';
>>load: 'glorp'.
>>
>>
>>
>> For SQLite:
>>
>> Metacello new
>>  repository: 'github://PierceNg/glorp-sqlite3:pharo7';
>>  baseline: 'GlorpSQLite';
>>  load.
>>
>>
>> but this fails with a conflict.  I suspect the conflict is it wants to
>> load in glorp again.
>>
>> I would also like to have mysql driver at some point.
>>
>> Any tips for getting these to play nice together would be great.
>>
>
>


Re: [Pharo-users] Glorp + P3 + SQLite

2019-11-21 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Hi Pavel,

I've just gotten around to figuring out BaslineOf and packages.  I see this 
work is in a branch on your own repository.

Do you plan to do a pull request back to the original repository?  I feel like 
we have database code all over the place and no clear "official" versions.

Stll trying to figure out what is current and what is obsolete (Garage?)

> On Oct 19, 2019, at 5:18 AM, Pavel Krivanek  wrote:
> 
> Btw. there exists an updated version of Glorp: 
> github://pavel-krivanek/glorp:8.3.1-23-baseline
> But the compatibility of it with SQLite was never tested
> 
> -- Pavel
> 
> so 19. 10. 2019 v 10:27 odesílatel Todd Blanchard via Pharo-users 
> mailto:pharo-users@lists.pharo.org>> napsal:
> I loaded GLORP+P3 without issue.
> 
> Trying to load SQLite3 - it also wants to load GLORP which complains of 
> conflict.
> 
> For P3 I used:
> 
> Metacello new
>baseline: 'P3';
>repository: 'github://svenvc/P3 <>';
>load: 'glorp'.
> 
> 
> For SQLite:
> 
> Metacello new 
>   repository: 'github://PierceNg/glorp-sqlite3:pharo7 <>';
>   baseline: 'GlorpSQLite';
>   load.
> 
> but this fails with a conflict.  I suspect the conflict is it wants to load 
> in glorp again.
> 
> I would also like to have mysql driver at some point.
> 
> Any tips for getting these to play nice together would be great.

--- End Message ---


Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-22 Thread Paul DeBruicker
The error you hit was because the package loader was smart enough to notice
that there was a version conflict between the version of a subproject
already in the image and what the new load instructions were telling it to
load.  The title of the debugger you pasted in alludes to that fact.  

So what you need to do is decide what to do when there is a conflict as its
tricky for a package manager to figure out what it should do in every case.  


Metacello includes an instruction #onConflict: which accepts a block.  You
can write code in the block to decide wether to use the incoming version or
the extant version in the image or whatever.  e.g.

Metacello new 
repository: 'github://PierceNg/glorp-sqlite3:pharo7';
baseline: 'GlorpSQLite';
onConflict:[:ex | ex allow]; 
load.

would likely get everything to load without issue.  Then you'd have to run
the tests to see if the version conflict caused problems.  
 



Pharo Smalltalk Users mailing list wrote
> Nice!  Thanks.
> 
> So here is maybe a stupid question (and I'm gonna read the wiki stuff on
> packages next) but it seems to me that the package loader should notice
> that glorp is already loaded and not load it if glorp is specified as a
> prerequisite but instead it fails.
> 
> Is the package loader not smart enough to understand what is already
> loaded and skip load attempts?
> 
> Puzzling.
> 
>> On Oct 19, 2019, at 11:23 PM, Pierce Ng 

> pierce@

>  wrote:
>> 
>> On Sat, Oct 19, 2019 at 01:26:10AM -0700, Todd Blanchard via Pharo-users
>> wrote:
>>> I loaded GLORP+P3 without issue.
>>> Trying to load SQLite3 - it also wants to load GLORP which complains of
>>> conflict.
>> 
>> Todd, to load SQLite3 only:
>> 
>>  Metacello new
>>repository: 'github://astares/Pharo-UDBC/src';
>>baseline: 'UDBC';
>>load: 'SQLite'
>> 
>> Pierce





--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-22 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
Nice!  Thanks.

So here is maybe a stupid question (and I'm gonna read the wiki stuff on 
packages next) but it seems to me that the package loader should notice that 
glorp is already loaded and not load it if glorp is specified as a prerequisite 
but instead it fails.

Is the package loader not smart enough to understand what is already loaded and 
skip load attempts?

Puzzling.

> On Oct 19, 2019, at 11:23 PM, Pierce Ng  wrote:
> 
> On Sat, Oct 19, 2019 at 01:26:10AM -0700, Todd Blanchard via Pharo-users 
> wrote:
>> I loaded GLORP+P3 without issue.
>> Trying to load SQLite3 - it also wants to load GLORP which complains of 
>> conflict.
> 
> Todd, to load SQLite3 only:
> 
>  Metacello new
>repository: 'github://astares/Pharo-UDBC/src';
>baseline: 'UDBC';
>load: 'SQLite'
> 
> Pierce


--- End Message ---


Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-20 Thread Hernán Morales Durand
Hi Todd,

El sáb., 19 oct. 2019 a las 13:11, Todd Blanchard via Pharo-users (<
pharo-users@lists.pharo.org>) escribió:

> I should probably mention that I do not really have a great handle on how
> package configurations work these days.
>
> Coming back to Smalltalk after a long time away.
>
>
Welcome back!


> Pointer to an explanation of how package configurations work would be
> great.
>
>
Have a look at:
https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md

Cheers,

Hernán


Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-20 Thread Pierce Ng
On Sat, Oct 19, 2019 at 01:26:10AM -0700, Todd Blanchard via Pharo-users wrote:
> I loaded GLORP+P3 without issue.
> Trying to load SQLite3 - it also wants to load GLORP which complains of 
> conflict.

Todd, to load SQLite3 only:

  Metacello new
repository: 'github://astares/Pharo-UDBC/src';
baseline: 'UDBC';
load: 'SQLite'

Pierce



Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-19 Thread Todd Blanchard via Pharo-users
--- Begin Message ---
I should probably mention that I do not really have a great handle on how 
package configurations work these days.

Coming back to Smalltalk after a long time away.

Pointer to an explanation of how package configurations work would be great.




--- End Message ---


Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-19 Thread Pavel Krivanek
Btw. there exists an updated version of Glorp:
github://pavel-krivanek/glorp:8.3.1-23-baseline
But the compatibility of it with SQLite was never tested

-- Pavel

so 19. 10. 2019 v 10:27 odesílatel Todd Blanchard via Pharo-users <
pharo-users@lists.pharo.org> napsal:

> I loaded GLORP+P3 without issue.
>
> Trying to load SQLite3 - it also wants to load GLORP which complains of
> conflict.
>
> For P3 I used:
>
> Metacello new
>baseline: 'P3';
>repository: 'github://svenvc/P3';
>load: 'glorp'.
>
>
>
> For SQLite:
>
> Metacello new
>   repository: 'github://PierceNg/glorp-sqlite3:pharo7';
>   baseline: 'GlorpSQLite';
>   load.
>
>
> but this fails with a conflict.  I suspect the conflict is it wants to
> load in glorp again.
>
> I would also like to have mysql driver at some point.
>
> Any tips for getting these to play nice together would be great.
>


Re: [Pharo-users] Glorp + P3 + SQLite

2019-10-19 Thread Sven Van Caekenberghe
Hi Todd,

Both specify their dependency on Glorp almost the same way:

P3:

spec baseline: 'Glorp' with: [ spec repository: 
'github://pharo-rdbms/glorp:master/'].

Sqlite3:

spec baseline: 'Glorp' with: [ spec repository: 'github://pharo-rdbms/glorp' ].

What exactly is the conflict ?

Sven

> On 19 Oct 2019, at 10:26, Todd Blanchard via Pharo-users 
>  wrote:
> 
> 
> From: Todd Blanchard 
> Subject: Glorp + P3 + SQLite
> Date: 19 October 2019 at 10:26:10 GMT+2
> To: Any question about pharo is welcome 
> 
> 
> I loaded GLORP+P3 without issue.
> 
> Trying to load SQLite3 - it also wants to load GLORP which complains of 
> conflict.
> 
> For P3 I used:
> 
> Metacello new
> 
>
> baseline: 'P3'
> ;
>
> repository: 'github://svenvc/P3'
> ;
>
> load: 'glorp'.
> 
> 
> For SQLite:
> 
> Metacello new
>  
>   
> repository: 'github://PierceNg/glorp-sqlite3:pharo7'
> ;
>   
> baseline: 'GlorpSQLite'
> ;
>   load.
> 
> 
> but this fails with a conflict.  I suspect the conflict is it wants to load 
> in glorp again.
> 
> I would also like to have mysql driver at some point.
> 
> Any tips for getting these to play nice together would be great.
> 
> 




Re: [Pharo-users] Glorp with P3

2018-10-11 Thread Sven Van Caekenberghe



> On 11 Oct 2018, at 02:26, Pierce Ng  wrote:
> 
> On Wed, Oct 10, 2018 at 11:12:37AM +0200, Sven Van Caekenberghe wrote:
>> I know that the actual PSQL DB that I am using has all the Glorp test
>> tables in it, I forgot whether that happened automatically or not.
> 
> The Glorp test database is set up by "#GlorpDemoTablePopulatorResource 
> asClass invalidateSetup".  In the case of Glorp-SQLite3, that step is
> done by BaselineOfGlorpSQLite>>postLoadDoIt.
> 
> Pierce

Ah, thanks !



Re: [Pharo-users] Glorp with P3

2018-10-10 Thread Pierce Ng
On Wed, Oct 10, 2018 at 11:12:37AM +0200, Sven Van Caekenberghe wrote:
> I know that the actual PSQL DB that I am using has all the Glorp test
> tables in it, I forgot whether that happened automatically or not.

The Glorp test database is set up by "#GlorpDemoTablePopulatorResource 
asClass invalidateSetup".  In the case of Glorp-SQLite3, that step is
done by BaselineOfGlorpSQLite>>postLoadDoIt.

Pierce



Re: [Pharo-users] Glorp with P3

2018-10-10 Thread Sven Van Caekenberghe



> On 10 Oct 2018, at 14:33, Craig  wrote:
> 
> Sven,
> 
> I just ported everything to Pharo 7.0 and the problem disappeared.
> 
> Craig

OK, good to know, but 6.1 should be compatible AFAIK.

> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
> Sven Van Caekenberghe
> Sent: Wednesday, 10 October 2018 11:13
> To: Any question about pharo is welcome
> Subject: Re: [Pharo-users] Glorp with P3
> 
> Craig,
> 
> I tried in a clean 
> Pharo-7.0.0+alpha.build.1276.sha.6c09bd43bb0d76c18958c720649aaf6834870bb5 (64 
> Bit).
> 
> Load expression (as per https://github.com/svenvc/P3), which also loads Glorp 
> itself:
> 
>  Metacello new
>baseline: 'P3';
>repository: 'github://svenvc/P3';
>load: 'glorp'.
> 
> Transcript log:
> 
> Fetched -> BaselineOfP3-CompatibleUserName.1539011881 --- 
> g...@github.com:svenvc/P3.git[master] --- 
> g...@github.com:svenvc/P3.git[master]
> Loaded -> BaselineOfP3-CompatibleUserName.1539011881 --- 
> g...@github.com:svenvc/P3.git[master] --- 
> g...@github.com:svenvc/P3.git[master]
> Loading baseline of BaselineOfP3...
> Fetched -> BaselineOfZTimestamp-CompatibleUserName.1538577426 --- 
> g...@github.com:svenvc/ztimestamp.git[master] --- 
> g...@github.com:svenvc/ztimestamp.git[master]
> Loaded -> BaselineOfZTimestamp-CompatibleUserName.1538577426 --- 
> g...@github.com:svenvc/ztimestamp.git[master] --- 
> g...@github.com:svenvc/ztimestamp.git[master]
> Fetched -> BaselineOfNeoJSON-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- 
> g...@github.com:svenvc/NeoJSON.git[master]
> Loaded -> BaselineOfNeoJSON-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- 
> g...@github.com:svenvc/NeoJSON.git[master]
> ...RETRY->ConfigurationOfGlorp
> Fetched -> ConfigurationOfGlorp-StephanEggermont.62 --- 
> http://smalltalkhub.com/mc/DBXTalk/Configurations/main/ --- 
> http://smalltalkhub.com/mc/DBXTalk/Configurations/main/
> Loaded -> ConfigurationOfGlorp-StephanEggermont.62 --- 
> http://smalltalkhub.com/mc/DBXTalk/Configurations/main/ --- 
> http://smalltalkhub.com/mc/DBXTalk/Configurations/main/
> Project: NeoJSON baseline
> Fetched -> Neo-JSON-Core-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- 
> g...@github.com:svenvc/NeoJSON.git[master]
> Fetched -> Neo-JSON-Tests-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- 
> g...@github.com:svenvc/NeoJSON.git[master]
> Fetched -> Neo-JSON-Pharo-Core-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- 
> g...@github.com:svenvc/NeoJSON.git[master]
> Fetched -> Neo-JSON-Pharo-Tests-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- 
> g...@github.com:svenvc/NeoJSON.git[master]
> Project: ZTimestamp baseline
> Fetched -> ZTimestamp-CompatibleUserName.1538577426 --- 
> g...@github.com:svenvc/ztimestamp.git[master] --- 
> g...@github.com:svenvc/ztimestamp.git[master]
> Project: Glorp stable [2.0.1]
> Fetched -> Glorp-HerbyVojcik.127 --- 
> http://smalltalkhub.com/mc/DBXTalk/Glorp/main/ --- 
> http://smalltalkhub.com/mc/DBXTalk/Glorp/main/
> Fetched -> Glorp-Tests-PierceNg.21 --- 
> http://smalltalkhub.com/mc/DBXTalk/Glorp/main/ --- 
> http://smalltalkhub.com/mc/DBXTalk/Glorp/main/
> Fetched -> P3-CompatibleUserName.1539011881 --- 
> g...@github.com:svenvc/P3.git[master] --- 
> g...@github.com:svenvc/P3.git[master]
> Fetched -> P3-Glorp-CompatibleUserName.1539011881 --- 
> g...@github.com:svenvc/P3.git[master] --- 
> g...@github.com:svenvc/P3.git[master]
> Loaded -> Neo-JSON-Core-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- cache
> Loaded -> Neo-JSON-Tests-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- cache
> Loaded -> Neo-JSON-Pharo-Core-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- cache
> Loaded -> Neo-JSON-Pharo-Tests-CompatibleUserName.1538429427 --- 
> g...@github.com:svenvc/NeoJSON.git[master] --- cache
> Loaded -> ZTimestamp-CompatibleUserName.1538577426 --- 
> g...@github.com:svenvc/ztimestamp.git[master] --- cache
> Starting atomic load
> MessageArchiver class>>inspectorClass (EyeProtoInspector is Undeclared) 
> 
> Dialect class>>reset (identitySetClass is Undeclared) 
> 
> DB2Sequence>>name: (DB2Platform is Undeclared) 
> 
>   Loaded -> Glorp-HerbyVojcik.127 --- 
> http://smalltalkhub.com/mc/DBXTalk/Glorp/main/ --- cache
>   Loaded -> Glorp-Tests-PierceN

Re: [Pharo-users] Glorp with P3

2018-10-10 Thread Craig
Sven,

I just ported everything to Pharo 7.0 and the problem disappeared.

Craig


-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Sven Van Caekenberghe
Sent: Wednesday, 10 October 2018 11:13
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Glorp with P3

Craig,

I tried in a clean 
Pharo-7.0.0+alpha.build.1276.sha.6c09bd43bb0d76c18958c720649aaf6834870bb5 (64 
Bit).

Load expression (as per https://github.com/svenvc/P3), which also loads Glorp 
itself:

  Metacello new
baseline: 'P3';
repository: 'github://svenvc/P3';
load: 'glorp'.

Transcript log:

Fetched -> BaselineOfP3-CompatibleUserName.1539011881 --- 
g...@github.com:svenvc/P3.git[master] --- g...@github.com:svenvc/P3.git[master]
Loaded -> BaselineOfP3-CompatibleUserName.1539011881 --- 
g...@github.com:svenvc/P3.git[master] --- g...@github.com:svenvc/P3.git[master]
Loading baseline of BaselineOfP3...
Fetched -> BaselineOfZTimestamp-CompatibleUserName.1538577426 --- 
g...@github.com:svenvc/ztimestamp.git[master] --- 
g...@github.com:svenvc/ztimestamp.git[master]
Loaded -> BaselineOfZTimestamp-CompatibleUserName.1538577426 --- 
g...@github.com:svenvc/ztimestamp.git[master] --- 
g...@github.com:svenvc/ztimestamp.git[master]
Fetched -> BaselineOfNeoJSON-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- 
g...@github.com:svenvc/NeoJSON.git[master]
Loaded -> BaselineOfNeoJSON-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- 
g...@github.com:svenvc/NeoJSON.git[master]
...RETRY->ConfigurationOfGlorp
Fetched -> ConfigurationOfGlorp-StephanEggermont.62 --- 
http://smalltalkhub.com/mc/DBXTalk/Configurations/main/ --- 
http://smalltalkhub.com/mc/DBXTalk/Configurations/main/
Loaded -> ConfigurationOfGlorp-StephanEggermont.62 --- 
http://smalltalkhub.com/mc/DBXTalk/Configurations/main/ --- 
http://smalltalkhub.com/mc/DBXTalk/Configurations/main/
Project: NeoJSON baseline
Fetched -> Neo-JSON-Core-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- 
g...@github.com:svenvc/NeoJSON.git[master]
Fetched -> Neo-JSON-Tests-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- 
g...@github.com:svenvc/NeoJSON.git[master]
Fetched -> Neo-JSON-Pharo-Core-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- 
g...@github.com:svenvc/NeoJSON.git[master]
Fetched -> Neo-JSON-Pharo-Tests-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- 
g...@github.com:svenvc/NeoJSON.git[master]
Project: ZTimestamp baseline
Fetched -> ZTimestamp-CompatibleUserName.1538577426 --- 
g...@github.com:svenvc/ztimestamp.git[master] --- 
g...@github.com:svenvc/ztimestamp.git[master]
Project: Glorp stable [2.0.1]
Fetched -> Glorp-HerbyVojcik.127 --- 
http://smalltalkhub.com/mc/DBXTalk/Glorp/main/ --- 
http://smalltalkhub.com/mc/DBXTalk/Glorp/main/
Fetched -> Glorp-Tests-PierceNg.21 --- 
http://smalltalkhub.com/mc/DBXTalk/Glorp/main/ --- 
http://smalltalkhub.com/mc/DBXTalk/Glorp/main/
Fetched -> P3-CompatibleUserName.1539011881 --- 
g...@github.com:svenvc/P3.git[master] --- g...@github.com:svenvc/P3.git[master]
Fetched -> P3-Glorp-CompatibleUserName.1539011881 --- 
g...@github.com:svenvc/P3.git[master] --- g...@github.com:svenvc/P3.git[master]
Loaded -> Neo-JSON-Core-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- cache
Loaded -> Neo-JSON-Tests-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- cache
Loaded -> Neo-JSON-Pharo-Core-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- cache
Loaded -> Neo-JSON-Pharo-Tests-CompatibleUserName.1538429427 --- 
g...@github.com:svenvc/NeoJSON.git[master] --- cache
Loaded -> ZTimestamp-CompatibleUserName.1538577426 --- 
g...@github.com:svenvc/ztimestamp.git[master] --- cache
Starting atomic load
MessageArchiver class>>inspectorClass (EyeProtoInspector is Undeclared) 

Dialect class>>reset (identitySetClass is Undeclared) 

DB2Sequence>>name: (DB2Platform is Undeclared) 

Loaded -> Glorp-HerbyVojcik.127 --- 
http://smalltalkhub.com/mc/DBXTalk/Glorp/main/ --- cache
Loaded -> Glorp-Tests-PierceNg.21 --- 
http://smalltalkhub.com/mc/DBXTalk/Glorp/main/ --- cache
Finished atomic load
Evaluated -> 2.0.1 [ConfigurationOfGlorp] >> resetDialect
Loaded -> P3-CompatibleUserName.1539011881 --- 
g...@github.com:svenvc/P3.git[master] --- cache
Loaded -> P3-Glorp-CompatibleUserName.1539011881 --- 
g...@github.com:svenvc/P3.git[master] --- cache
...finished baseline

Then set the driver using:

  PharoDatabaseAccessor DefaultDriver: P3DatabaseDriver.

Next configure the unit tests (login resource) via:

  GlorpDatabaseLoginResource defaultLogin: (Login new
database: PostgreSQLPlatform new;
 

Re: [Pharo-users] Glorp with P3

2018-10-10 Thread Sven Van Caekenberghe
ned automatically or 
not.

As for the full test suite, if I exclude GlorpReadingTest I get 

  804 run, 788 passes, 4 skipped, 0 expected failures, 0 failures, 16 errors, 0 
unexpected passes

Which is not too bad for such a complex package.

HTH,

Sven

> On 10 Oct 2018, at 09:36, Craig  wrote:
> 
> Hi Sven,
> 
> Thanks for the support.
> 
> I'm using Pharo 6.1 - 32bit stable.
> 
> Craig
> 
> -Original Message-
> From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
> Sven Van Caekenberghe
> Sent: Wednesday, 10 October 2018 08:56
> To: Any question about pharo is welcome
> Subject: Re: [Pharo-users] Glorp with P3
> 
> Hi Craig,
> 
> Last time I checked, this worked fine. I'll try again later today, what 
> version of Pharo are you using ?
> 
> Sven
> 
>> On 9 Oct 2018, at 15:43, Craig  wrote:
>> 
>> Hi All,
>> 
>> I installed Glorp with P3 using the snippet on the P3 Github page.
>> 
>> P3 seems to be working fine.  The tests are Ok.  While working through the 
>> Glorp book, I got as far as “session createTables” and then got a debugger 
>> window.
>> 
>> It seems that the SQL is being sent to a variable in the 
>> PharoDatabaseAccessor class  - “databaseDriver” which is never initialised.
>> 
>> Anybody able to assist with this?
>> 
>> Craig
> 
> 
> 
> 




Re: [Pharo-users] Glorp with P3

2018-10-10 Thread Craig
Hi Sven,

Thanks for the support.

I'm using Pharo 6.1 - 32bit stable.

Craig

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Sven Van Caekenberghe
Sent: Wednesday, 10 October 2018 08:56
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Glorp with P3

Hi Craig,

Last time I checked, this worked fine. I'll try again later today, what version 
of Pharo are you using ?

Sven

> On 9 Oct 2018, at 15:43, Craig  wrote:
> 
> Hi All,
>  
> I installed Glorp with P3 using the snippet on the P3 Github page.
>  
> P3 seems to be working fine.  The tests are Ok.  While working through the 
> Glorp book, I got as far as “session createTables” and then got a debugger 
> window.
>  
> It seems that the SQL is being sent to a variable in the 
> PharoDatabaseAccessor class  - “databaseDriver” which is never initialised.
>  
> Anybody able to assist with this?
>  
> Craig






Re: [Pharo-users] Glorp with P3

2018-10-10 Thread Sven Van Caekenberghe
Hi Craig,

Last time I checked, this worked fine. I'll try again later today, what version 
of Pharo are you using ?

Sven

> On 9 Oct 2018, at 15:43, Craig  wrote:
> 
> Hi All,
>  
> I installed Glorp with P3 using the snippet on the P3 Github page.
>  
> P3 seems to be working fine.  The tests are Ok.  While working through the 
> Glorp book, I got as far as “session createTables” and then got a debugger 
> window.
>  
> It seems that the SQL is being sent to a variable in the 
> PharoDatabaseAccessor class  - “databaseDriver” which is never initialised.
>  
> Anybody able to assist with this?
>  
> Craig




Re: [Pharo-users] Glorp v130 call for testing

2017-12-03 Thread Alistair Grant
On 1 December 2017 at 13:46, Alistair Grant  wrote:
> Hi Everyone,
>
> There haven't been any complaints about the merged version, and Glorp
> fails to load #development on Pharo 7, so I'm planning to update
> ConfigurationOfGlorp to:
>
> - Work on Pharo7 when given the #development symbolic version
> - Make Glorp-AlistairGrant.130 the stable version - up from
> Glorp-HerbyVojcik.127.
>
> If I don't hear any objections in the next couple of days I'll make the 
> change.

I haven't heard any objections, so... ConfigurationOfGlorp-AlistairGrant.63:

- Promote Glorp-AlistairGrant.130 to stable
- Add Pharo 7 support to #development symbolic version

Cheers,
Alistair



Re: [Pharo-users] Glorp: #includesKey:

2017-10-25 Thread Herby Vojčík

Niall Ross wrote:

Dear Herby,
adding #includesKey: is certainly doable. If you look at callers above
and subcallers below #anySatisfyDefault: you will see the issues
involved. Your includesKey: needs the same degree of platform-awareness
that Glorp's #anySatisfy: and #allSatisfy: implementations use. But
since #anySatisfy: is there, you have a ready template to follow.


I don't feel competent enough, from what I looked, Glorp innards are a 
bit complex.



Alternatively, I may well add #includesKey: - though not as my most
urgent task. :-) I did a fair amount of work to extend the usability of
DictionaryMappings in Glorp three years ago (part of demonstrating the
ObjectStudio business-mapping/Glorp-generating tools - see my ESUG 2014
presentation for details) but I did not then think of providing
#includesKey:. Thanks for suggesting the idea.


My pleasure. :-)

As I wrote elsewhere, also #keys is something (probably the most 
general) one that could be added as a matter of allowing to work with 
the key field - as far as I was able to find out, there is no way to 
actually get to the key, for which I found workaround since I mapped 
object, but would be out of luck if I mapped single primitive value.


For the moment, it is not pressing, but yes, it would be nice to be able 
to have #keys mapping to key field and #includesKey: as an idiomatic way 
to do keys includes:.


Thanks again, Herby


If you were to work on this, be aware:

- always reinitialise FunctionExpression class after adding/changing any
Glorp function (or just close and reopen your image, of course)

- If (and only if) you construct Query whereClauses in stages (e.g. you
have code like

myQuery AND: [:customer | customer orders includesKey: #onlineOrders]

or similar) then, using its callers in GlorpTest as a guide, know when
you might need to send #setUpBaseFromSession: to your query while doing
so. (N.B. that method is a Glorp version 8.2.1 addition; you will not
have it in older Glorp.) The point is that stage-constructed where
clauses must convert from block to expression before execution, to
combine the stages. Any that use #anySatisfy:/#allSatisfy: need
platform-specific information to do this; I would expect any
#includesKey: implementation to be the same.

HTH
Niall Ross


Tom Robinson wrote:

Hi Herby,

In my opinion, the way you found to make it work is the way it should
be. The reason is that the first way doesn't translate into SQL and the
second one does. It might be possible to add includesKey: functionality
but resolving that to SQL would be more complex. I would not call this a
bug. I would call it a limitation of the implementation. I don't know of
anyone planning to add this feature to Glorp right now.

Regards,

Tom

On 10/24/2017 12:27 PM, Herby Vojčík wrote:


Hello!

I am using a DictionaryMapping in my code, and I wanted to use
#includesKey: in #where: clause (something akin

each tools includesKey: aToolId

) to select only rows for which DictionaryMapping uses certain key. It
failed with the error in the lines of "#tools does not resolve to
field". I had to come up with

each tools anySatisfy: [ :tool | tool id = aToolId ]

Is it the bug / feature / problem in my approach? If bug, is it
planned to add #includesKey: translation to DictionaryMapping?

Thanks, Herby







Re: [Pharo-users] Glorp: #includesKey:

2017-10-25 Thread Herby Vojčík

jtuc...@objektfabrik.de wrote:

Herby,

I must admit I've never used Dictionary Mappings with Glorp, so I don't
have an answer.
But I am a bit confused by your code examples. See below


Am 24.10.17 um 20:27 schrieb Herby Vojčík:

Hello!

I am using a DictionaryMapping in my code, and I wanted to use
#includesKey: in #where: clause (something akin

  each tools includesKey: aToolId


What SQL expression would you expect here?


SELECT * FROM AGENT a WHERE a.tool_id = :aToolId

AFAICT, DISTINCT is not needed as  are fks to other table's 
compound primary key , so they are known to be unique.



I would guess that you want to build a subquery like exists, because the
way I understand the query, you want to find all instances of (whatever
each is) that hold an Association in their tools dictionary where the
key is aToolId.


Yes.

Maybe it needs EXISTS, I don't know. Semantics is clear, though.



) to select only rows for which DictionaryMapping uses certain key. It
failed with the error in the lines of "#tools does not resolve to
field". I had to come up with




each tools anySatisfy: [ :tool | tool id = aToolId ]

Hmm. This makes me wonder. Is #tools really a Dictionary? Inside the
Block, I'd expect the :tool parameter to be an Association, and that
doesn't understand #id,does it? I guess @each is the parameter within an
Block like in

self session read: MyClass where: [:each| each tools ...]

If so, I have a hard time believing that anySatisfy: would work (never
tried)...


Yes, it works. Dictionary enumerates values, as I have written in reply 
to Tom's post.



Is it the bug / feature / problem in my approach? If bug, is it
planned to add #includesKey: translation to DictionaryMapping?


I don't know, but would guess it is not currently on the Todo-list.

My first tip would be to try and find some slides (most likely made by
Niall and presented at an ESUG) including the words "subquery", "glorp"
and "exists". You won't find much, but that may be a starting point.


I actually managed to get there, but
  a) using ugly workaround IMO, #includesKey: is part of dictionary's 
protocol, should be known;
  b) as I wrote in Tom's reply, the workaround only worked because 
mapping was to object. If the mapping was to primitive value (number, 
string), I would not have any 'tool id' ready to use and I would be left 
 without option. There is no way to construct such query atm in 
Glorp, afaict, if I cannot use #keys not #includesKey: in where clause. 
Is that not a bug?



Not sure this helps, ;-)


Joachim


Thanks, Herby



Re: [Pharo-users] Glorp: #includesKey:

2017-10-25 Thread Herby Vojčík

Tom Robinson wrote:

Hi Herby,

In my opinion, the way you found to make it work is the way it should
be. The reason is that the first way doesn't translate into SQL and the
second one does. It might be possible to add includesKey: functionality
but resolving that to SQL would be more complex. I would not call this a


I think I disagree with this, but correct me if I am wrong.

With DictionaryMapping, you map a set of (key, value) pairs into 
appropriate fields in a table. In essence, it does not differ at all to 
mapping any other collection containing objects with fields (actually, 
from what I understood, it does internal tricks to do just that - create 
internal "class mapping" for an association of that particular 
dictionary mapping).


In case of primitive value dictionaries, it even _is_ the same: key is 
mapped to one field, value is mapped to different field. If I want to 
create subquery using value, I can freely use things like #anySatisfy: 
to filter on that value (which I did in my case, but I come to that 
later). Since Dictionary enumerates values in do:, select:, collect: 
(and anySatisfy:), writing


  each tools anySatisfy: [...]

is the same as writing

  each tools values anySatisfy: [...]

but what if I wanted to write

  each tools keys anySatisfy: [...]

? I cannot, Glorp fails on 'keys' (I tried to use `keys includes:` 
instead of `includesKey:`, to no avail).


So what I want to point here is, that in DictionaryMapping I map keys 
and values to different fields in table (values can be complex, in which 
keys they are mapped to more fields, but that is not important 
distinction here), but Glorp only allows me to use values (and only 
implicitly) in where clauses; I have no way to use keys at all there.


So I assert here that "resolving that to SQL would be more complex" is 
not true. Key is mapped the same way value is; if I can use where clause 
that uses value in certain way, I should be able to use key as well - 
SQL generating from one or the other have same level of difficulty (in 
fact, I think key is easier, as you do not actually need to join the 
foreign table); the generated SQL could be something like


  SELECT * FROM AGENT a
WHERE a.tool_id = 

The fact that I found a

  each tools anySatisfy: [ :tool | tool id = aToolId ]

is in fact only because non-primitive mappings are processed differently 
in DictionaryMapping, a non-primitive values are _required_ to have a 
field defined (not in table, that is understandable, I need to be able 
to make a join, but in descriptor) a mapping that contains the key. So 
in essence, that could be represented as


  SELECT * FROM AGENT a
WHERE a.tool_id IN
 (SELECT * FROM TOOL t
   WHERE t.agent_id = a.id
 AND t.id = a.tool_id
 AND t.id = )

which is basically same as above, as actually, "a.tool_id = asDbValue>" is executed here as well (plus checking that such dictionary 
actually exists at all; maybe that should be present in previous case as 
well, but Glorp can generate the join, that's not the question here).


It is actually interesting question what SQL Glorp actually generated 
for "TgAgent readOneOf: [:a|a tools anySatisfy: [:t|t id = toolId]]".


Point here is:

  1. Why do I need to work it around via [:tool | tool id = aToolId] 
when I am only interested on "which tools the agent uses" (in fact, give 
me all agents using this tool).
  2. Should this be key -> primitive value mapping, I have simple _no 
way_ to ask the equivalent of #includesKey: at all (as the value is, for 
example, a String or an Integer, so no `tool id` is available).



bug. I would call it a limitation of the implementation. I don't know of
anyone planning to add this feature to Glorp right now.


That's why I would say #keys (and, ideally, #includesKey:) are actually 
needed addition to Glorp's set of known-and-translated selectors in case 
of DictionaryMapping.



Regards,

Tom


Thanks, Herby




Re: [Pharo-users] Glorp: #includesKey:

2017-10-24 Thread jtuc...@objektfabrik.de

Herby,

I must admit I've never used Dictionary Mappings with Glorp, so I don't 
have an answer.

But I am a bit confused by your code examples. See below


Am 24.10.17 um 20:27 schrieb Herby Vojčík:

Hello!

I am using a DictionaryMapping in my code, and I wanted to use 
#includesKey: in #where: clause (something akin


  each tools includesKey: aToolId


What SQL expression would you expect here?

I would guess that you want to build a subquery like exists, because the 
way I understand the query, you want to find all instances of (whatever 
each is) that hold an Association in their tools dictionary where the 
key is aToolId.


) to select only rows for which DictionaryMapping uses certain key. It 
failed with the error in the lines of "#tools does not resolve to 
field". I had to come up with





each tools anySatisfy: [ :tool | tool id = aToolId ]
Hmm. This makes me wonder. Is #tools really a Dictionary? Inside the 
Block, I'd expect the :tool parameter to be an Association, and that 
doesn't understand #id,does it? I guess @each is the parameter within an 
Block like in


self session read: MyClass where: [:each| each tools ...]

If so, I have a hard time believing that anySatisfy: would work (never 
tried)...






Is it the bug / feature / problem in my approach? If bug, is it 
planned to add #includesKey: translation to DictionaryMapping?



I don't know, but would guess it is not currently on the Todo-list.

My first tip would be to try and find some slides (most likely made by 
Niall and presented at an ESUG) including the words "subquery", "glorp" 
and "exists". You won't find much, but that may be a starting point.


Not sure this helps, ;-)


Joachim


--
---
Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1




Re: [Pharo-users] Glorp: Is there some way to do insert-or-update?

2017-08-24 Thread herby


On August 24, 2017 7:26:00 AM GMT+02:00, "jtuc...@objektfabrik.de" 
 wrote:
>Am 23.08.17 um 11:08 schrieb Herby Vojčík:
>> jtuchel wrote:
>>> Herby,
>>>
>>> as Esteban already said, UPSERT doesn't make any sense in an ORM. It
>>
>> I don't know... I just create new object (with same "primary key")
>and 
>> register it (yes, I know I get an error - maybe I should be able to 
>> set the policy to "overwrite" and it would makes sense; or not?).
>>
>What I mean is that for an ORM, an object can only be new or old. It
>can 
>only be sure an object is Old if either
>a) The ORM itself has loaded it from the database
>b) the user forcibly tells it that an object is old
>
>There is no maybe in an ORM's world, because the consequences of maybe 
>can make the whole thing brittle. Maybe would make optimistic locking 
>and other mechanisms obsolete.
>
>>> either knows the object as one that has been read in this session or
>>> not. If not, it is new and needs to be inserted.
>>>
>>> You could, of course, try and see what happens if you let Glorp's
>insert
>>> operation always issue an UPSERT. This is probably very easy to do
>and
>>> at first sight there isn't too much I could think of that could go
>wrong
>>> with it.
>>>
>>> But I guess including a check for existence of an object as Esteban
>>> suggests isn't too bad from the performance and "safety" POV. not
>sure I
>>> understand how a Dictionary Mapping could help here
>>
>> Similarly to what was posted above: I can simply at:put: and I don't 
>> care if I created the new key-value pair or overwritten the old value
>
>> (in cases where simply putting new object under a key is feasible, 
>> which is in this case).
>
>Still don't understand. An object has its attributes that are used as 
>its identification for the corresponding row in the DB (the primary key
>
>thereof). That is also true for objects that are the value of an 
>Asscoiation. The Smalltalk Dictionary is translated to something that 
>holds references to objects by their primary key (Haven't used Dict 

Yes, this cannot be avoided.
But in cases where I want to write over the item, I am not forced to choose 
between two different approaches and just use at:put:.

So it IMO helps from client code PoV.

>mappings yet, but I'd guess it's a link table). So I don't see how that
>
>would solve your problem an object's primary key is either known in a 
>session or it isn't. If it is, the object is known to have existed in 
>the database at read time, if not, it's assumed to be new.
>
>If it is assumed to be new, the DB provides a mechanism for avoiding 
>damage by its Uniqueness constraint and the ORM can only rely on that.
>
>
>Joachim



Re: [Pharo-users] Glorp: Is there some way to do insert-or-update?

2017-08-23 Thread jtuc...@objektfabrik.de

Am 23.08.17 um 11:08 schrieb Herby Vojčík:

jtuchel wrote:

Herby,

as Esteban already said, UPSERT doesn't make any sense in an ORM. It


I don't know... I just create new object (with same "primary key") and 
register it (yes, I know I get an error - maybe I should be able to 
set the policy to "overwrite" and it would makes sense; or not?).


What I mean is that for an ORM, an object can only be new or old. It can 
only be sure an object is Old if either

a) The ORM itself has loaded it from the database
b) the user forcibly tells it that an object is old

There is no maybe in an ORM's world, because the consequences of maybe 
can make the whole thing brittle. Maybe would make optimistic locking 
and other mechanisms obsolete.



either knows the object as one that has been read in this session or
not. If not, it is new and needs to be inserted.

You could, of course, try and see what happens if you let Glorp's insert
operation always issue an UPSERT. This is probably very easy to do and
at first sight there isn't too much I could think of that could go wrong
with it.

But I guess including a check for existence of an object as Esteban
suggests isn't too bad from the performance and "safety" POV. not sure I
understand how a Dictionary Mapping could help here


Similarly to what was posted above: I can simply at:put: and I don't 
care if I created the new key-value pair or overwritten the old value 
(in cases where simply putting new object under a key is feasible, 
which is in this case).


Still don't understand. An object has its attributes that are used as 
its identification for the corresponding row in the DB (the primary key 
thereof). That is also true for objects that are the value of an 
Asscoiation. The Smalltalk Dictionary is translated to something that 
holds references to objects by their primary key (Haven't used Dict 
mappings yet, but I'd guess it's a link table). So I don't see how that 
would solve your problem an object's primary key is either known in a 
session or it isn't. If it is, the object is known to have existed in 
the database at read time, if not, it's assumed to be new.


If it is assumed to be new, the DB provides a mechanism for avoiding 
damage by its Uniqueness constraint and the ORM can only rely on that.



Joachim





Re: [Pharo-users] Glorp: Is there some way to do insert-or-update?

2017-08-23 Thread Herby Vojčík

jtuchel wrote:

Herby,

as Esteban already said, UPSERT doesn't make any sense in an ORM. It


I don't know... I just create new object (with same "primary key") and 
register it (yes, I know I get an error - maybe I should be able to set 
the policy to "overwrite" and it would makes sense; or not?).



either knows the object as one that has been read in this session or
not. If not, it is new and needs to be inserted.

You could, of course, try and see what happens if you let Glorp's insert
operation always issue an UPSERT. This is probably very easy to do and
at first sight there isn't too much I could think of that could go wrong
with it.

But I guess including a check for existence of an object as Esteban
suggests isn't too bad from the performance and "safety" POV. not sure I
understand how a Dictionary Mapping could help here


Similarly to what was posted above: I can simply at:put: and I don't 
care if I created the new key-value pair or overwritten the old value 
(in cases where simply putting new object under a key is feasible, which 
is in this case).



Joachim


Herby


Am Dienstag, 22. August 2017 12:13:30 UTC+2 schrieb Herbert Vojčík:

Hello!

Is there some way to do insert-or-update operation (that is,
roughly, to
be able to register an object with possibly existing primary key(s) and
let it be written regardless?

Thanks, Herby

P.S.: Use case - I want to have log of USER-DEVICE pairing with last
timestamp and 'enabled' field that would be set to false once push
notification fails - but set to true once user actually logs from the
device (again). I don't want to have many historical records, so I want
to have USER+DEVICE to be a composed primary key. Which means it is
inserted first time, but possibly updated later.

--
You received this message because you are subscribed to the Google
Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to glorp-group+unsubscr...@googlegroups.com
.
To post to this group, send email to glorp-gr...@googlegroups.com
.
Visit this group at https://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.





Re: [Pharo-users] Glorp: Is there some way to do insert-or-update?

2017-08-22 Thread jtuchel
Herby,

as Esteban already said, UPSERT doesn't make any sense in an ORM. It either 
knows the object as one that has been read in this session or not. If not, 
it is new and needs to be inserted.

You could, of course, try and see what happens if you let Glorp's insert 
operation always issue an UPSERT. This is probably very easy to do and at 
first sight there isn't too much I could think of that could go wrong with 
it.

But I guess including a check for existence of an object as Esteban 
suggests isn't too bad from the performance and "safety" POV. not sure I 
understand how a Dictionary Mapping could help here

Joachim




Am Dienstag, 22. August 2017 12:13:30 UTC+2 schrieb Herbert Vojčík:
>
> Hello! 
>
> Is there some way to do insert-or-update operation (that is, roughly, to 
> be able to register an object with possibly existing primary key(s) and 
> let it be written regardless? 
>
> Thanks, Herby 
>
> P.S.: Use case - I want to have log of USER-DEVICE pairing with last 
> timestamp and 'enabled' field that would be set to false once push 
> notification fails - but set to true once user actually logs from the 
> device (again). I don't want to have many historical records, so I want 
> to have USER+DEVICE to be a composed primary key. Which means it is 
> inserted first time, but possibly updated later. 
>


Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Herby Vojčík

Esteban A. Maringolo wrote:

2017-08-06 8:05 GMT-03:00 Herby Vojčík:

Guillermo Polito wrote:

How did you install garage and glorp? Catalog, configurations? Can you
paste here the installation instructions you followed?


Just adding GarageGlorp as dependency:
 configuration: 'GarageGlorp' with: [ spec
 version: #stable;
 repository:



I presume this is how it should be done?


It is. [1]



In fact, from what I saw, it seems Glorp accumulated its share of technical
debt, drivers came and went, platforms, too, dialects on which it runs, too.
It seems to me it needs serious detanglement. Get rid of ifs, structure
clenly, change ifs comparing to hardcoded symbols with double dispatch, etc.


Glorp as a project accumulates technical debt because it is an old
framework, which in the last years has received maintenance in its
main trunk but is missing several refactorings and a good
re-architecture of its internals.

Also, since there wasn't an official maintenance of the ports from VW
to other languages, there are many "old" ports still around, some
work, some doesn't, but they add to the confusion. Think of Seaside
being ported several times from Pharo to, let's say, VW, and many of
those ports were abandoned for a long time.

I attach a screenshot from the latest version of Glorp in VisualWorks
8 (the main trunk), it has the same login methods as the Pharo
version.


Yeah, those probably aren't a problem (though, sometime self accessor, 
sometimes accessor), it's PharoDatabaseAccessor >> encoding which sends 
the mythical #queryEncoding.



[1] See: 
http://files.pharo.org/books-pdfs/booklet-Glorp/2017-05-02-Glorp-Spiral.pdf


Yeah, thanks, without that book I would be hardly be able to use Glorp 
at all.



Regards,

Esteban A. Maringolo





Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Esteban A. Maringolo
2017-08-06 8:05 GMT-03:00 Herby Vojčík :
> Guillermo Polito wrote:
>>
>> How did you install garage and glorp? Catalog, configurations? Can you
>> paste here the installation instructions you followed?
>
>
> Just adding GarageGlorp as dependency:
> configuration: 'GarageGlorp' with: [ spec
> version: #stable;
> repository:

> I presume this is how it should be done?

It is. [1]


> In fact, from what I saw, it seems Glorp accumulated its share of technical
> debt, drivers came and went, platforms, too, dialects on which it runs, too.
> It seems to me it needs serious detanglement. Get rid of ifs, structure
> clenly, change ifs comparing to hardcoded symbols with double dispatch, etc.

Glorp as a project accumulates technical debt because it is an old
framework, which in the last years has received maintenance in its
main trunk but is missing several refactorings and a good
re-architecture of its internals.

Also, since there wasn't an official maintenance of the ports from VW
to other languages, there are many "old" ports still around, some
work, some doesn't, but they add to the confusion. Think of Seaside
being ported several times from Pharo to, let's say, VW, and many of
those ports were abandoned for a long time.

I attach a screenshot from the latest version of Glorp in VisualWorks
8 (the main trunk), it has the same login methods as the Pharo
version.

[1] See: 
http://files.pharo.org/books-pdfs/booklet-Glorp/2017-05-02-Glorp-Spiral.pdf

Regards,

Esteban A. Maringolo


Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Herby Vojčík

Guillermo Polito wrote:

How did you install garage and glorp? Catalog, configurations? Can you
paste here the installation instructions you followed?


Just adding GarageGlorp as dependency:

baseline: spec
   
spec for: #common do: [ spec

package: 'Towergame' with: [ spec
requires: #('GarageGlorp' 'NeoJSON') ];
package: 'Towergame-Tests' with: [ spec
requires: #('Towergame' 'Mocketry') ];

configuration: 'GarageGlorp' with: [ spec
version: #stable;
repository: 
'http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main' ];
configuration: 'NeoJSON' with: [ spec
version: #stable;
repository: 
'http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main' ];
baseline: 'Mocketry' with: [ spec
repository: 'github://dionisiydk/Mocketry:v4.0.x' ];

group: 'default' with: #('Core');
group: 'development' with: #('Core' 'Tests');
group: 'Core' with: #('Towergame');
group: 'Tests' with: #('Towergame-Tests') ]

and loading it in script via

Metacello new baseline: 'Towergame'; repository: 'gitlocal:///', 
(hereRef / 'src') fullName; load: 'development'.


I presume this is how it should be done?

---

But, does that affect the presence of queryEncoding? It's the mythincal 
creature, I have browsed repos out there, history of development of 
Glorp and found it nowhere.


Did it actually exist? :-)

In fact, from what I saw, it seems Glorp accumulated its share of 
technical debt, drivers came and went, platforms, too, dialects on which 
it runs, too. It seems to me it needs serious detanglement. Get rid of 
ifs, structure clenly, change ifs comparing to hardcoded symbols with 
double dispatch, etc. :-(


Herby

P.S.: And most of all, add one smoke test to test it with each login 
type that actually uses `session login`, not database accessor's one 
(not seen, but it was mention in this thread or the one linked below no 
test actually sends `session login`).




On Sun, Aug 6, 2017 at 1:37 AM, Herby Vojčík > wrote:

Herby Vojčík wrote:

Guillermo Polito wrote:

AFAIR, PharoDatabaseAccessor was meant to work with
SqueakDBX/DBXTalk
driver. No other driver should use it. At the time Garage
did not even
exist.

So I'd say that you should not use PharoDatabaseAccessor
with another
driver than the one it was originally mean to? I do not know
exactly
your setup, I was not following this thread.

Really I cannot tell much more. This was really long time ago.


Great to know!

I am not using it consciously, though. System somehow selects it and
uses it in the background (I just do MyDescriptorSystem
sessionForLogin:
myLoginObject; and before that I set GarageGlorpDrive to be the
default).

This seems to be the actual fix (make Glorp with Garage not use
PharoDatabaseAccessor).


Actually, probably not. It is more in, it should be fixed to work
with Garage. It has lots of functionality there... :-(



Herby


On Sun, Aug 6, 2017 at 12:20 AM, Herby Vojčík

>> wrote:

Esteban A. Maringolo wrote:

Herby,

I regularly use `session login`, but I don't use SQLite in
Pharo, but I
do in VisualWorks and it works just fine.
Maybe if there is a bug we should fix it. Even with a no-op
method.

Regards!

Esteban A. Maringolo


It's hard. The problem is

PharoDatabaseAccessor >> encoding
^self connection queryEncoding

which overrides parent, which is atm:

encoding
"The connection is specific to the dialect; some dialects
will need
to override this method."

^connection encoding

The former was added at GuillermoPolito.73 back in 2011 (and the
latter was the same back then). It probably fixed something,
but I
don't see any implementors of queryEncoding atm (definitely
not in
Garage). From the diff it is clear lots of databases and drivers
have gone. Now, why was it change for Pharo (and does it
need to be
changed in 2017)?

Ccing Guillermo Polito.

Herby

P.S.: I wonder how it is that no one actually had problem
with this?
This predictably fails on `session login` 

Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Pierce Ng
On Sun, Aug 06, 2017 at 12:54:41AM +0200, Herby Vojčík wrote:
> Pharo is 6.1, Glorp, Garage etc. are #stable loaded from Pharo60
> catalog (see attachment).

You may want to try GlorpSQLite. Load from Catalog Browser into a fresh 60510
image. All 889 tests should pass, as has been the case since Pharo 5. In
GlorpSQLite, #encoding is implemented by UDBCDatabaseDriver.

Pierce




Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-06 Thread Guillermo Polito
How did you install garage and glorp? Catalog, configurations? Can you
paste here the installation instructions you followed?

On Sun, Aug 6, 2017 at 1:37 AM, Herby Vojčík  wrote:

> Herby Vojčík wrote:
>
>> Guillermo Polito wrote:
>>
>>> AFAIR, PharoDatabaseAccessor was meant to work with SqueakDBX/DBXTalk
>>> driver. No other driver should use it. At the time Garage did not even
>>> exist.
>>>
>>> So I'd say that you should not use PharoDatabaseAccessor with another
>>> driver than the one it was originally mean to? I do not know exactly
>>> your setup, I was not following this thread.
>>>
>>> Really I cannot tell much more. This was really long time ago.
>>>
>>
>> Great to know!
>>
>> I am not using it consciously, though. System somehow selects it and
>> uses it in the background (I just do MyDescriptorSystem sessionForLogin:
>> myLoginObject; and before that I set GarageGlorpDrive to be the default).
>>
>> This seems to be the actual fix (make Glorp with Garage not use
>> PharoDatabaseAccessor).
>>
>
> Actually, probably not. It is more in, it should be fixed to work with
> Garage. It has lots of functionality there... :-(
>
>
>
>> Herby
>>
>>
>>> On Sun, Aug 6, 2017 at 12:20 AM, Herby Vojčík >> > wrote:
>>>
>>> Esteban A. Maringolo wrote:
>>>
>>> Herby,
>>>
>>> I regularly use `session login`, but I don't use SQLite in
>>> Pharo, but I
>>> do in VisualWorks and it works just fine.
>>> Maybe if there is a bug we should fix it. Even with a no-op method.
>>>
>>> Regards!
>>>
>>> Esteban A. Maringolo
>>>
>>>
>>> It's hard. The problem is
>>>
>>> PharoDatabaseAccessor >> encoding
>>> ^self connection queryEncoding
>>>
>>> which overrides parent, which is atm:
>>>
>>> encoding
>>> "The connection is specific to the dialect; some dialects will need
>>> to override this method."
>>>
>>> ^connection encoding
>>>
>>> The former was added at GuillermoPolito.73 back in 2011 (and the
>>> latter was the same back then). It probably fixed something, but I
>>> don't see any implementors of queryEncoding atm (definitely not in
>>> Garage). From the diff it is clear lots of databases and drivers
>>> have gone. Now, why was it change for Pharo (and does it need to be
>>> changed in 2017)?
>>>
>>> Ccing Guillermo Polito.
>>>
>>> Herby
>>>
>>> P.S.: I wonder how it is that no one actually had problem with this?
>>> This predictably fails on `session login` on pharo, unless
>>> queryEncoding is somehow magically present without seeing it in
>>> source code for other platforms?
>>>
>>>
>>> 2017-08-05 15:52 GMT-03:00 Herby Vojčík >> 
>>> >>:
>>>
>>> Alistair Grant wrote:
>>>
>>> Hi Herby,
>>>
>>> On 5 August 2017 at 18:09, Herby
>>> Vojčík
>>> >> wrote:
>>>
>>> Hello!
>>>
>>> First of all, what is preferred way to (first time)
>>> login
>>> into database? I
>>> had the impression that `aDatabaseAccessor login`
>>> is sorta
>>> low-level, and
>>> one should do `session login` (after all, it is
>>> session you
>>> get to work
>>> with, not an accessor).
>>>
>>> But with Garage SQLite, `session login`, when
>>> accessor is
>>> not logged, always
>>> fails with "MessageNotUnderstood:
>>> GASqlite3Driver>>queryEncoding".
>>>
>>> Should one not use `session login` at all, then (when
>>> accessor is logged, it
>>> just does nothing, if it isn't, it connects the
>>> accessor,
>>> but tries to do
>>> some additional work which always fails)?
>>>
>>> Herby
>>>
>>>
>>> From memory this is caused by differences between
>>> VisualWorks
>>> and Pharo.
>>>
>>> Anyway, it is discussed and resolved in:
>>>
>>> http://forum.world.st/Glorp-SQLite3-issue-td4899792.html
>>> 
>>> >> >
>>>
>>>
>>> Doesn't look like solved to me. Anyway, at least I know it
>>> is known
>>> for year and no-one seemed to see it as a bug.
>>>
>>> I think it is one (you cannot just send queryEncoding where
>>> no class
>>> implements it and be fine, imo).
>>>
>>> So what is the state of `session login`? Is it meant to be
>>> used, or
>>> everyone just took a step down to low-level and uses `accessor
>>> login` instead? :-(
>>>
>>>
>>> Cheers,
>>> Alistair
>>>
>>>
>>> Thanks, Herby
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>>
>>> Guille Polito
>>>
>>>
>>> Research Engineer
>>>
>>> French National Center for Scientific Research - _http://www.cnrs.fr_
>>>
>>>
>>>
>>> *Web:* _http://guillep.github.io_
>>>
>>> *Phone: *+33 06 52 70 66 13
>>>
>>>
>>
>>
>


-- 



Guille Polito


Research Engineer

French National Center for Scientific Research - *http://www.cnrs.fr*




*Web:* *http://guillep.github.io* 

*Phone: 

Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Herby Vojčík

Herby Vojčík wrote:

Guillermo Polito wrote:

AFAIR, PharoDatabaseAccessor was meant to work with SqueakDBX/DBXTalk
driver. No other driver should use it. At the time Garage did not even
exist.

So I'd say that you should not use PharoDatabaseAccessor with another
driver than the one it was originally mean to? I do not know exactly
your setup, I was not following this thread.

Really I cannot tell much more. This was really long time ago.


Great to know!

I am not using it consciously, though. System somehow selects it and
uses it in the background (I just do MyDescriptorSystem sessionForLogin:
myLoginObject; and before that I set GarageGlorpDrive to be the default).

This seems to be the actual fix (make Glorp with Garage not use
PharoDatabaseAccessor).


Actually, probably not. It is more in, it should be fixed to work with 
Garage. It has lots of functionality there... :-(




Herby



On Sun, Aug 6, 2017 at 12:20 AM, Herby Vojčík > wrote:

Esteban A. Maringolo wrote:

Herby,

I regularly use `session login`, but I don't use SQLite in
Pharo, but I
do in VisualWorks and it works just fine.
Maybe if there is a bug we should fix it. Even with a no-op method.

Regards!

Esteban A. Maringolo


It's hard. The problem is

PharoDatabaseAccessor >> encoding
^self connection queryEncoding

which overrides parent, which is atm:

encoding
"The connection is specific to the dialect; some dialects will need
to override this method."

^connection encoding

The former was added at GuillermoPolito.73 back in 2011 (and the
latter was the same back then). It probably fixed something, but I
don't see any implementors of queryEncoding atm (definitely not in
Garage). From the diff it is clear lots of databases and drivers
have gone. Now, why was it change for Pharo (and does it need to be
changed in 2017)?

Ccing Guillermo Polito.

Herby

P.S.: I wonder how it is that no one actually had problem with this?
This predictably fails on `session login` on pharo, unless
queryEncoding is somehow magically present without seeing it in
source code for other platforms?


2017-08-05 15:52 GMT-03:00 Herby Vojčík 
>>:

Alistair Grant wrote:

Hi Herby,

On 5 August 2017 at 18:09, Herby
Vojčík
>> wrote:

Hello!

First of all, what is preferred way to (first time)
login
into database? I
had the impression that `aDatabaseAccessor login`
is sorta
low-level, and
one should do `session login` (after all, it is
session you
get to work
with, not an accessor).

But with Garage SQLite, `session login`, when
accessor is
not logged, always
fails with "MessageNotUnderstood:
GASqlite3Driver>>queryEncoding".

Should one not use `session login` at all, then (when
accessor is logged, it
just does nothing, if it isn't, it connects the
accessor,
but tries to do
some additional work which always fails)?

Herby


From memory this is caused by differences between
VisualWorks
and Pharo.

Anyway, it is discussed and resolved in:

http://forum.world.st/Glorp-SQLite3-issue-td4899792.html

>


Doesn't look like solved to me. Anyway, at least I know it
is known
for year and no-one seemed to see it as a bug.

I think it is one (you cannot just send queryEncoding where
no class
implements it and be fine, imo).

So what is the state of `session login`? Is it meant to be
used, or
everyone just took a step down to low-level and uses `accessor
login` instead? :-(


Cheers,
Alistair


Thanks, Herby






--



Guille Polito


Research Engineer

French National Center for Scientific Research - _http://www.cnrs.fr_



*Web:* _http://guillep.github.io_

*Phone: *+33 06 52 70 66 13









Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Herby Vojčík

Guillermo Polito wrote:

AFAIR, PharoDatabaseAccessor was meant to work with SqueakDBX/DBXTalk
driver. No other driver should use it. At the time Garage did not even
exist.

So I'd say that you should not use PharoDatabaseAccessor with another
driver than the one it was originally mean to? I do not know exactly
your setup, I was not following this thread.

Really I cannot tell much more. This was really long time ago.


Great to know!

I am not using it consciously, though. System somehow selects it and 
uses it in the background (I just do MyDescriptorSystem sessionForLogin: 
myLoginObject; and before that I set GarageGlorpDrive to be the default).


This seems to be the actual fix (make Glorp with Garage not use 
PharoDatabaseAccessor).


Herby



On Sun, Aug 6, 2017 at 12:20 AM, Herby Vojčík > wrote:

Esteban A. Maringolo wrote:

Herby,

I regularly use `session login`, but I don't use SQLite in
Pharo, but I
do in VisualWorks and it works just fine.
Maybe if there is a bug we should fix it. Even with a no-op method.

Regards!

Esteban A. Maringolo


It's hard. The problem is

PharoDatabaseAccessor >> encoding
  ^self connection queryEncoding

which overrides parent, which is atm:

encoding
"The connection is specific to the dialect;  some dialects will need
to override this method."

 ^connection encoding

The former was added at GuillermoPolito.73 back in 2011 (and the
latter was the same back then). It probably fixed something, but I
don't see any implementors of queryEncoding atm (definitely not in
Garage). From the diff it is clear lots of databases and drivers
have gone. Now, why was it change for Pharo (and does it need to be
changed in 2017)?

Ccing Guillermo Polito.

Herby

P.S.: I wonder how it is that no one actually had problem with this?
This predictably fails on `session login` on pharo, unless
queryEncoding is somehow magically present without seeing it in
source code for other platforms?


2017-08-05 15:52 GMT-03:00 Herby Vojčík 
>>:

 Alistair Grant wrote:

 Hi Herby,

 On 5 August 2017 at 18:09, Herby
Vojčík
>>  wrote:

 Hello!

 First of all, what is preferred way to (first time)
login
 into database? I
 had the impression that `aDatabaseAccessor login`
is sorta
 low-level, and
 one should do `session login` (after all, it is
session you
 get to work
 with, not an accessor).

 But with Garage SQLite, `session login`, when
accessor is
 not logged, always
 fails with "MessageNotUnderstood:
 GASqlite3Driver>>queryEncoding".

 Should one not use `session login` at all, then (when
 accessor is logged, it
 just does nothing, if it isn't, it connects the
accessor,
 but tries to do
 some additional work which always fails)?

 Herby


   From memory this is caused by differences between
VisualWorks
 and Pharo.

 Anyway, it is discussed and resolved in:

http://forum.world.st/Glorp-SQLite3-issue-td4899792.html

>


 Doesn't look like solved to me. Anyway, at least I know it
is known
 for year and no-one seemed to see it as a bug.

 I think it is one (you cannot just send queryEncoding where
no class
 implements it and be fine, imo).

 So what is the state of `session login`? Is it meant to be
used, or
 everyone just took a step down to low-level and uses `accessor
 login` instead? :-(


 Cheers,
 Alistair


 Thanks, Herby






--



Guille Polito


Research Engineer

French National Center for Scientific Research - _http://www.cnrs.fr_



*Web:* _http://guillep.github.io_

*Phone: *+33 06 52 70 66 13






Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Herby Vojčík

Esteban A. Maringolo wrote:

Which version of Pharo, Glorp and SQLite are you using?


As for SQLite dll, I don't know (does it change the fact if 
queryEncoding method is present?).


Pharo is 6.1, Glorp, Garage etc. are #stable loaded from Pharo60 catalog 
(see attachment).


Herby




Esteban A. Maringolo


2017-08-05 19:20 GMT-03:00 Herby Vojčík:

Esteban A. Maringolo wrote:

Herby,

I regularly use `session login`, but I don't use SQLite in Pharo, but I
do in VisualWorks and it works just fine.
Maybe if there is a bug we should fix it. Even with a no-op method.

Regards!

Esteban A. Maringolo


It's hard. The problem is

PharoDatabaseAccessor>>  encoding
  ^self connection queryEncoding

which overrides parent, which is atm:

encoding
 "The connection is specific to the dialect;  some dialects will need
to override this method."

 ^connection encoding

The former was added at GuillermoPolito.73 back in 2011 (and the latter was
the same back then). It probably fixed something, but I don't see any
implementors of queryEncoding atm (definitely not in Garage). From the diff
it is clear lots of databases and drivers have gone. Now, why was it change
for Pharo (and does it need to be changed in 2017)?

Ccing Guillermo Polito.

Herby

P.S.: I wonder how it is that no one actually had problem with this? This
predictably fails on `session login` on pharo, unless queryEncoding is
somehow magically present without seeing it in source code for other
platforms?


2017-08-05 15:52 GMT-03:00 Herby Vojčík>:

 Alistair Grant wrote:

 Hi Herby,

 On 5 August 2017 at 18:09, Herby Vojčík>   wrote:

 Hello!

 First of all, what is preferred way to (first time) login
 into database? I
 had the impression that `aDatabaseAccessor login` is sorta
 low-level, and
 one should do `session login` (after all, it is session you
 get to work
 with, not an accessor).

 But with Garage SQLite, `session login`, when accessor is
 not logged, always
 fails with "MessageNotUnderstood:
 GASqlite3Driver>>queryEncoding".

 Should one not use `session login` at all, then (when
 accessor is logged, it
 just does nothing, if it isn't, it connects the accessor,
 but tries to do
 some additional work which always fails)?

 Herby


   From memory this is caused by differences between VisualWorks
 and Pharo.

 Anyway, it is discussed and resolved in:

 http://forum.world.st/Glorp-SQLite3-issue-td4899792.html
 


 Doesn't look like solved to me. Anyway, at least I know it is known
 for year and no-one seemed to see it as a bug.

 I think it is one (you cannot just send queryEncoding where no class
 implements it and be fine, imo).

 So what is the state of `session login`? Is it meant to be used, or
 everyone just took a step down to low-level and uses `accessor
 login` instead? :-(


 Cheers,
 Alistair


 Thanks, Herby










Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Esteban A. Maringolo
Which version of Pharo, Glorp and SQLite are you using?


Esteban A. Maringolo


2017-08-05 19:20 GMT-03:00 Herby Vojčík :
> Esteban A. Maringolo wrote:
>>
>> Herby,
>>
>> I regularly use `session login`, but I don't use SQLite in Pharo, but I
>> do in VisualWorks and it works just fine.
>> Maybe if there is a bug we should fix it. Even with a no-op method.
>>
>> Regards!
>>
>> Esteban A. Maringolo
>
>
> It's hard. The problem is
>
> PharoDatabaseAccessor >> encoding
>  ^self connection queryEncoding
>
> which overrides parent, which is atm:
>
> encoding
> "The connection is specific to the dialect;  some dialects will need
> to override this method."
>
> ^connection encoding
>
> The former was added at GuillermoPolito.73 back in 2011 (and the latter was
> the same back then). It probably fixed something, but I don't see any
> implementors of queryEncoding atm (definitely not in Garage). From the diff
> it is clear lots of databases and drivers have gone. Now, why was it change
> for Pharo (and does it need to be changed in 2017)?
>
> Ccing Guillermo Polito.
>
> Herby
>
> P.S.: I wonder how it is that no one actually had problem with this? This
> predictably fails on `session login` on pharo, unless queryEncoding is
> somehow magically present without seeing it in source code for other
> platforms?
>
>>
>> 2017-08-05 15:52 GMT-03:00 Herby Vojčík > >:
>>
>> Alistair Grant wrote:
>>
>> Hi Herby,
>>
>> On 5 August 2017 at 18:09, Herby Vojčík> >  wrote:
>>
>> Hello!
>>
>> First of all, what is preferred way to (first time) login
>> into database? I
>> had the impression that `aDatabaseAccessor login` is sorta
>> low-level, and
>> one should do `session login` (after all, it is session you
>> get to work
>> with, not an accessor).
>>
>> But with Garage SQLite, `session login`, when accessor is
>> not logged, always
>> fails with "MessageNotUnderstood:
>> GASqlite3Driver>>queryEncoding".
>>
>> Should one not use `session login` at all, then (when
>> accessor is logged, it
>> just does nothing, if it isn't, it connects the accessor,
>> but tries to do
>> some additional work which always fails)?
>>
>> Herby
>>
>>
>>   From memory this is caused by differences between VisualWorks
>> and Pharo.
>>
>> Anyway, it is discussed and resolved in:
>>
>> http://forum.world.st/Glorp-SQLite3-issue-td4899792.html
>> 
>>
>>
>> Doesn't look like solved to me. Anyway, at least I know it is known
>> for year and no-one seemed to see it as a bug.
>>
>> I think it is one (you cannot just send queryEncoding where no class
>> implements it and be fine, imo).
>>
>> So what is the state of `session login`? Is it meant to be used, or
>> everyone just took a step down to low-level and uses `accessor
>> login` instead? :-(
>>
>>
>> Cheers,
>> Alistair
>>
>>
>> Thanks, Herby
>>
>>
>
>



Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Guillermo Polito
AFAIR, PharoDatabaseAccessor was meant to work with SqueakDBX/DBXTalk
driver. No other driver should use it. At the time Garage did not even
exist.

So I'd say that you should not use PharoDatabaseAccessor with another
driver than the one it was originally mean to? I do not know exactly your
setup, I was not following this thread.

Really I cannot tell much more. This was really long time ago.

On Sun, Aug 6, 2017 at 12:20 AM, Herby Vojčík  wrote:

> Esteban A. Maringolo wrote:
>
>> Herby,
>>
>> I regularly use `session login`, but I don't use SQLite in Pharo, but I
>> do in VisualWorks and it works just fine.
>> Maybe if there is a bug we should fix it. Even with a no-op method.
>>
>> Regards!
>>
>> Esteban A. Maringolo
>>
>
> It's hard. The problem is
>
> PharoDatabaseAccessor >> encoding
>  ^self connection queryEncoding
>
> which overrides parent, which is atm:
>
> encoding
> "The connection is specific to the dialect;  some dialects will
> need to override this method."
>
> ^connection encoding
>
> The former was added at GuillermoPolito.73 back in 2011 (and the latter
> was the same back then). It probably fixed something, but I don't see any
> implementors of queryEncoding atm (definitely not in Garage). From the diff
> it is clear lots of databases and drivers have gone. Now, why was it change
> for Pharo (and does it need to be changed in 2017)?
>
> Ccing Guillermo Polito.
>
> Herby
>
> P.S.: I wonder how it is that no one actually had problem with this? This
> predictably fails on `session login` on pharo, unless queryEncoding is
> somehow magically present without seeing it in source code for other
> platforms?
>
>
>> 2017-08-05 15:52 GMT-03:00 Herby Vojčík > >:
>>
>> Alistair Grant wrote:
>>
>> Hi Herby,
>>
>> On 5 August 2017 at 18:09, Herby Vojčík> >  wrote:
>>
>> Hello!
>>
>> First of all, what is preferred way to (first time) login
>> into database? I
>> had the impression that `aDatabaseAccessor login` is sorta
>> low-level, and
>> one should do `session login` (after all, it is session you
>> get to work
>> with, not an accessor).
>>
>> But with Garage SQLite, `session login`, when accessor is
>> not logged, always
>> fails with "MessageNotUnderstood:
>> GASqlite3Driver>>queryEncoding".
>>
>> Should one not use `session login` at all, then (when
>> accessor is logged, it
>> just does nothing, if it isn't, it connects the accessor,
>> but tries to do
>> some additional work which always fails)?
>>
>> Herby
>>
>>
>>   From memory this is caused by differences between VisualWorks
>> and Pharo.
>>
>> Anyway, it is discussed and resolved in:
>>
>> http://forum.world.st/Glorp-SQLite3-issue-td4899792.html
>> 
>>
>>
>> Doesn't look like solved to me. Anyway, at least I know it is known
>> for year and no-one seemed to see it as a bug.
>>
>> I think it is one (you cannot just send queryEncoding where no class
>> implements it and be fine, imo).
>>
>> So what is the state of `session login`? Is it meant to be used, or
>> everyone just took a step down to low-level and uses `accessor
>> login` instead? :-(
>>
>>
>> Cheers,
>> Alistair
>>
>>
>> Thanks, Herby
>>
>>
>>
>


-- 



Guille Polito


Research Engineer

French National Center for Scientific Research - *http://www.cnrs.fr*




*Web:* *http://guillep.github.io* 

*Phone: *+33 06 52 70 66 13


Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Herby Vojčík

Esteban A. Maringolo wrote:

Herby,

I regularly use `session login`, but I don't use SQLite in Pharo, but I
do in VisualWorks and it works just fine.
Maybe if there is a bug we should fix it. Even with a no-op method.

Regards!

Esteban A. Maringolo


It's hard. The problem is

PharoDatabaseAccessor >> encoding
 ^self connection queryEncoding

which overrides parent, which is atm:

encoding
	"The connection is specific to the dialect;  some dialects will need to 
override this method."


^connection encoding

The former was added at GuillermoPolito.73 back in 2011 (and the latter 
was the same back then). It probably fixed something, but I don't see 
any implementors of queryEncoding atm (definitely not in Garage). From 
the diff it is clear lots of databases and drivers have gone. Now, why 
was it change for Pharo (and does it need to be changed in 2017)?


Ccing Guillermo Polito.

Herby

P.S.: I wonder how it is that no one actually had problem with this? 
This predictably fails on `session login` on pharo, unless queryEncoding 
is somehow magically present without seeing it in source code for other 
platforms?




2017-08-05 15:52 GMT-03:00 Herby Vojčík >:

Alistair Grant wrote:

Hi Herby,

On 5 August 2017 at 18:09, Herby Vojčík>  wrote:

Hello!

First of all, what is preferred way to (first time) login
into database? I
had the impression that `aDatabaseAccessor login` is sorta
low-level, and
one should do `session login` (after all, it is session you
get to work
with, not an accessor).

But with Garage SQLite, `session login`, when accessor is
not logged, always
fails with "MessageNotUnderstood:
GASqlite3Driver>>queryEncoding".

Should one not use `session login` at all, then (when
accessor is logged, it
just does nothing, if it isn't, it connects the accessor,
but tries to do
some additional work which always fails)?

Herby


  From memory this is caused by differences between VisualWorks
and Pharo.

Anyway, it is discussed and resolved in:

http://forum.world.st/Glorp-SQLite3-issue-td4899792.html



Doesn't look like solved to me. Anyway, at least I know it is known
for year and no-one seemed to see it as a bug.

I think it is one (you cannot just send queryEncoding where no class
implements it and be fine, imo).

So what is the state of `session login`? Is it meant to be used, or
everyone just took a step down to low-level and uses `accessor
login` instead? :-(


Cheers,
Alistair


Thanks, Herby







Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Esteban A. Maringolo
Herby,

I regularly use `session login`, but I don't use SQLite in Pharo, but I do
in VisualWorks and it works just fine.
Maybe if there is a bug we should fix it. Even with a no-op method.

Regards!

Esteban A. Maringolo

2017-08-05 15:52 GMT-03:00 Herby Vojčík :

> Alistair Grant wrote:
>
>> Hi Herby,
>>
>> On 5 August 2017 at 18:09, Herby Vojčík  wrote:
>>
>>> Hello!
>>>
>>> First of all, what is preferred way to (first time) login into database?
>>> I
>>> had the impression that `aDatabaseAccessor login` is sorta low-level, and
>>> one should do `session login` (after all, it is session you get to work
>>> with, not an accessor).
>>>
>>> But with Garage SQLite, `session login`, when accessor is not logged,
>>> always
>>> fails with "MessageNotUnderstood: GASqlite3Driver>>queryEncoding".
>>>
>>> Should one not use `session login` at all, then (when accessor is
>>> logged, it
>>> just does nothing, if it isn't, it connects the accessor, but tries to do
>>> some additional work which always fails)?
>>>
>>> Herby
>>>
>>
>>  From memory this is caused by differences between VisualWorks and Pharo.
>>
>> Anyway, it is discussed and resolved in:
>>
>> http://forum.world.st/Glorp-SQLite3-issue-td4899792.html
>>
>
> Doesn't look like solved to me. Anyway, at least I know it is known for
> year and no-one seemed to see it as a bug.
>
> I think it is one (you cannot just send queryEncoding where no class
> implements it and be fine, imo).
>
> So what is the state of `session login`? Is it meant to be used, or
> everyone just took a step down to low-level and uses `accessor login`
> instead? :-(
>
>
>> Cheers,
>> Alistair
>>
>>
> Thanks, Herby
>
>


Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Herby Vojčík

Alistair Grant wrote:

Hi Herby,

On 5 August 2017 at 18:09, Herby Vojčík  wrote:

Hello!

First of all, what is preferred way to (first time) login into database? I
had the impression that `aDatabaseAccessor login` is sorta low-level, and
one should do `session login` (after all, it is session you get to work
with, not an accessor).

But with Garage SQLite, `session login`, when accessor is not logged, always
fails with "MessageNotUnderstood: GASqlite3Driver>>queryEncoding".

Should one not use `session login` at all, then (when accessor is logged, it
just does nothing, if it isn't, it connects the accessor, but tries to do
some additional work which always fails)?

Herby


 From memory this is caused by differences between VisualWorks and Pharo.

Anyway, it is discussed and resolved in:

http://forum.world.st/Glorp-SQLite3-issue-td4899792.html


Doesn't look like solved to me. Anyway, at least I know it is known for 
year and no-one seemed to see it as a bug.


I think it is one (you cannot just send queryEncoding where no class 
implements it and be fine, imo).


So what is the state of `session login`? Is it meant to be used, or 
everyone just took a step down to low-level and uses `accessor login` 
instead? :-(




Cheers,
Alistair



Thanks, Herby



Re: [Pharo-users] Glorp: `session login` fails for Garage SQLite

2017-08-05 Thread Alistair Grant
Hi Herby,

On 5 August 2017 at 18:09, Herby Vojčík  wrote:
> Hello!
>
> First of all, what is preferred way to (first time) login into database? I
> had the impression that `aDatabaseAccessor login` is sorta low-level, and
> one should do `session login` (after all, it is session you get to work
> with, not an accessor).
>
> But with Garage SQLite, `session login`, when accessor is not logged, always
> fails with "MessageNotUnderstood: GASqlite3Driver>>queryEncoding".
>
> Should one not use `session login` at all, then (when accessor is logged, it
> just does nothing, if it isn't, it connects the accessor, but tries to do
> some additional work which always fails)?
>
> Herby

>From memory this is caused by differences between VisualWorks and Pharo.

Anyway, it is discussed and resolved in:

http://forum.world.st/Glorp-SQLite3-issue-td4899792.html

Cheers,
Alistair



Re: [Pharo-users] Glorp reconnection management (was: Re: Glorp: how to reconnect after image shutdown / load?)

2017-08-04 Thread Pierce Ng
On Thu, Aug 03, 2017 at 03:27:16PM +0200, Herby Vojčík wrote:
> Looking at state of the art code:
> GlorpSession >> loginIfError: aBlock
>   | result |
>   result := self accessor loginIfError: aBlock.
>   system platform characterEncoding: accessor encoding.
>   ^result

In the line "result := self accessor loginIfError: aBlock", "self accessor" is
not an instance of DatabaseAccessor, because

  DatabaseAccessor>>loginIfError: aBlock
self subclassResponsibility

"self accessor" is an instance of PharoDatabaseAccessor, and

  PharoDatabaseAccessor>>loginIfError: aBlock
self log: 'Login'.
self databaseDriver: self connectionClass new.
self
  execute: [
self databaseDriver connect: currentLogin.
currentLogin secure
  ifTrue: [ currentLogin discardPassword ]
]
  ifError: aBlock.
self log: 'Login finished'

  PharoDatabaseAccessor>>isLoggedIn
self databaseDriver ifNil: [^ false].
^ self databaseDriver isConnected

Connecting to my instance of Reddit (actually RedditSt20 using SQLite not
PostgreSQL), adding a link and then clicking refresh, Transcript shows:

  Login
  Login finished
  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.points DESC LIMIT 20  an OrderedCollection()
  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.created DESC LIMIT 20  an 
OrderedCollection()
  Begin Transaction
  INSERT INTO REDDIT_LINKS (url,title,created,points)  VALUES (?,?,?,?)  
an Array('http://planet.smalltalk.org' 'Planet Smalltalk' 
2017-08-04T22:25:14.558667+08:00 0)
  SELECT last_insert_rowid()
  (0.0 s)
  Commit Transaction
  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.points DESC LIMIT 20  an OrderedCollection()
  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.created DESC LIMIT 20  an 
OrderedCollection()

Login happened once. Clicking "New Session":

  Logout
  Logout finished
  Login
  Login finished
  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.points DESC LIMIT 20  an OrderedCollection()
  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.created DESC LIMIT 20  an 
OrderedCollection()

Clicking "Refresh" in the application:

  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.points DESC LIMIT 20  an OrderedCollection()
  SELECT t1.id, t1.url, t1.title, t1.created, t1.points
   FROM REDDIT_LINKS t1 ORDER BY t1.created DESC LIMIT 20  an 
OrderedCollection()


Pierce




Re: [Pharo-users] Glorp reconnection management (was: Re: Glorp: how to reconnect after image shutdown / load?)

2017-08-03 Thread Herby Vojčík

Pierce Ng wrote:

On Wed, Aug 02, 2017 at 11:30:27AM +0200, Herby Vojčík wrote:

Hm, I though that once I open a session it does actually connect on
demand (it has Login, system and all the information for it). Does
it actually mean that if I want to stay connected I must do `session
login` before each `session inUnitOfWorkDo:`?


No.


Great.


As written above, I thought glorp manages this kind of reconnection
itself. If not, can someone point me to the some example where this
is managed? I am asking because in Glorp book I did not find
anything about this (I have read it).


If used with Seaside, typically when a Seaside session is started, your
application's custom subclass of WASession starts a database session, be it for
Glorp, some other OODB, good olde SQL, etc. From Sven's Reddit.st:

   RedditSession>>glorpSession
 glorpSession ifNil: [ glorpSession := self newGlorpSession ].


Yeah, I ended up with this. And planning to set it to nil on each image 
loading (not sure how, yet, I don't want to register a class as a 
handler, but I'll manage, I hope).



 glorpSession accessor isLoggedIn
   ifFalse: [ glorpSession accessor login ].


Looking at state of the art code:


DatabaseAccessor >> login

| |
self loginIfError: [:ex |
ex pass].
	"Just to help avoid confusion if someone thinks they're getting a login 
object back from this"

^nil.


GlorpSession >> isLoggedIn
^accessor isLoggedIn


GlorpSession >> login
self isLoggedIn ifTrue: [^nil].
^self loginIfError: [:ex | ex pass]


GlorpSession >> loginIfError: aBlock
| result |
result := self accessor loginIfError: aBlock.
system platform characterEncoding: accessor encoding.
^result


it seems this `... ifFalse: ...` is in fact the same thing as 
`glorpSession login` (yes, it does set an encoding, but otherwise, it's 
the same, isn't it)?


Doesn't this counter the previous "no", in fact? If I do all operations 
via `self glorpSession doSomething`, then it actually does `glorpSession 
login` before each action...



 ^ glorpSession

See the senders of #glorpSession.

Also read the chapters of HPI's Seaside tutorial on tasks&  sessions, and
persistence.

   http://www.hpi.uni-potsdam.de/hirschfeld/seaside/tutorial


1. Link does not load.
2. I am doing it with ZnServer, no Seaside there.


Pierce


Thanks, Herby




Re: [Pharo-users] Glorp reconnection management (was: Re: Glorp: how to reconnect after image shutdown / load?)

2017-08-03 Thread Pierce Ng
On Wed, Aug 02, 2017 at 11:30:27AM +0200, Herby Vojčík wrote:
> Hm, I though that once I open a session it does actually connect on
> demand (it has Login, system and all the information for it). Does
> it actually mean that if I want to stay connected I must do `session
> login` before each `session inUnitOfWorkDo:`?

No. 

> As written above, I thought glorp manages this kind of reconnection
> itself. If not, can someone point me to the some example where this
> is managed? I am asking because in Glorp book I did not find
> anything about this (I have read it).

If used with Seaside, typically when a Seaside session is started, your
application's custom subclass of WASession starts a database session, be it for
Glorp, some other OODB, good olde SQL, etc. From Sven's Reddit.st:

  RedditSession>>glorpSession
glorpSession ifNil: [ glorpSession := self newGlorpSession ].
glorpSession accessor isLoggedIn
  ifFalse: [ glorpSession accessor login ].
^ glorpSession

See the senders of #glorpSession.

Also read the chapters of HPI's Seaside tutorial on tasks & sessions, and
persistence.

  http://www.hpi.uni-potsdam.de/hirschfeld/seaside/tutorial

Pierce




Re: [Pharo-users] Glorp: how to reconnect after image shutdown / load?

2017-08-02 Thread jtuc...@objektfabrik.de

Herby,

I am not aware of any automatic reconnect tools. Kepping a DB connection 
alive after an image is closed is surely not desired and chances are the 
DB will close the inactive session eventually anyways.


So it's probably best to make the DB connections reconnect on demand. 
That means that whenever you open a session, check if a DB connection is 
available or establish a new one otherwise.


There are many scenarios that can lead to the los of a DB connection 
that you usually cannot influence (network connection drops, DB server 
has some error condition etc.) , so this is a good idea anyways.



HTH

Joachim


Am 01.08.17 um 22:29 schrieb Herby Vojčík:

Hello!

ZnServers have its own register mechanism by which they listen when 
they are tagged as such after image save and load.


I wonder if there is some way to connect to database in Glorp and then 
"keep the connection" between image save/load. Or how is this managed 
notmally in apps that use databases? Is image "preconfigured" with 
live self-healing connection or does some special piece of startup 
code be installed so it runs after deployment and image start?


Thanks, Herby





--
---
Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1




Re: [Pharo-users] Glorp

2016-10-02 Thread stepharo

Ah tx for the explanation.

I'm sure that I like bundles for the sake of them.


should not we removed DBXGlorp if it is not up to date?

Is BDXGlorp based on latest Glorp port?

GlorpDBX is nothing but a name to a Metacello config that used to load
both Glorp and the OpenDBX (now garageDB) drivers.


Esteban A. Maringolo







Re: [Pharo-users] Glorp

2016-10-02 Thread Esteban A. Maringolo
2016-10-02 2:37 GMT-03:00 stepharo :
> should not we removed DBXGlorp if it is not up to date?
>
> Is BDXGlorp based on latest Glorp port?

GlorpDBX is nothing but a name to a Metacello config that used to load
both Glorp and the OpenDBX (now garageDB) drivers.


Esteban A. Maringolo



Re: [Pharo-users] Glorp

2016-10-01 Thread stepharo

should not we removed DBXGlorp if it is not up to date?

Is BDXGlorp based on latest Glorp port?


Le 1/10/16 à 08:36, Benoit St-Jean via Pharo-users a écrit :




Re: [Pharo-users] Glorp

2016-09-30 Thread Benoit St-Jean via Pharo-users
--- Begin Message ---
I typically use MySQL but since I'm into databases a lot, I'll probably play 
with PostgreSQL, DB2, Oracle, SQLite and SQL Server as well...  I guess this 
port of Glorp also allows for an ODBC accessor or it only supports native 
connectors?
If that helps, I'm on Windows 10
 - 
Benoît St-Jean 
Yahoo! Messenger: bstjean 
Twitter: @BenLeChialeux 
Pinterest: benoitstjean 
Instagram: Chef_Benito
IRC: lamneth 
Blogue: endormitoire.wordpress.com 
"A standpoint is an intellectual horizon of radius zero".  (A. Einstein)

  From: Renaud de Villemeur <renaud.devillem...@free.fr>
 To: Benoit St-Jean <bstj...@yahoo.com>; Any question about pharo is welcome 
<pharo-users@lists.pharo.org> 
 Sent: Friday, September 30, 2016 9:50 PM
 Subject: Re: [Pharo-users] Glorp
   
Hi.
This documentation should give you the first 
hint:https://ci.inria.fr/pharo-contribution/job/PharoBookWorkInProgress/lastSuccessfulBuild/artifact/book-result/Glorp/Glorp.html

It's still a work in progress, but the install part is accurate.  Do you plan 
to use it with Sqlite, or with MySql/postgreSQL
Renaud

2016-09-30 21:23 GMT-04:00 Benoit St-Jean via Pharo-users 
<pharo-users@lists.pharo.org>:



-- Message transféré --
From: Benoit St-Jean <bstj...@yahoo.com>
To: "pharo-users@lists.pharo.org" <pharo-users@lists.pharo.org>
Cc: 
Date: Sat, 1 Oct 2016 01:21:57 + (UTC)
Subject: Glorp
Hello Pharoers,
I want to use Glorp and I am puzzled as to what to install.
I have found a few Glorp related package and I really don't know which one to 
use nor which one is current.  Besides, those packages are spread across 
different websites.

So, which one should I use? And from where?
My current Pharo 5.0 images has the following in the Pharo Project Catalog :

Glorp? GlorpDBX? Garage?
On a different note, if anyone's interested, I'd be more than happy to 
test/fix/participate/develop for Glorp.  I have had the chance (ahem!?!?!?) to 
develop with TOPLink (Glorp's ancestor) for quite a while so Glorp is somewhat 
familiar to me.  In that case, where's the current effort/version to develop 
Glorp for Pharo and which Pharo version is the preferred one for 
development/tests ?

tia - 
Benoît St-Jean 
Yahoo! Messenger: bstjean 
Twitter: @BenLeChialeux 
Pinterest: benoitstjean 
Instagram: Chef_Benito
IRC: lamneth 
Blogue: endormitoire.wordpress.com 
"A standpoint is an intellectual horizon of radius zero".  (A. Einstein)




   --- End Message ---


Re: [Pharo-users] Glorp

2016-09-30 Thread Renaud de Villemeur
Hi.

This documentation should give you the first hint:
https://ci.inria.fr/pharo-contribution/job/PharoBookWorkInProgress/lastSuccessfulBuild/artifact/book-result/Glorp/Glorp.html

It's still a work in progress, but the install part is accurate.  Do you
plan to use it with Sqlite, or with MySql/postgreSQL

Renaud


2016-09-30 21:23 GMT-04:00 Benoit St-Jean via Pharo-users <
pharo-users@lists.pharo.org>:

>
>
> -- Message transféré --
> From: Benoit St-Jean 
> To: "pharo-users@lists.pharo.org" 
> Cc:
> Date: Sat, 1 Oct 2016 01:21:57 + (UTC)
> Subject: Glorp
> Hello Pharoers,
>
> I want to use Glorp and I am puzzled as to what to install.
>
> I have found a few Glorp related package and I really don't know which one
> to use nor which one is current.  Besides, those packages are spread across
> different websites.
>
> So, which one should I use? And from where?
>
> My current Pharo 5.0 images has the following in the Pharo Project
> Catalog :
>
> Glorp? GlorpDBX? Garage?
>
> On a different note, if anyone's interested, I'd be more than happy to
> test/fix/participate/develop for Glorp.  I have had the chance (ahem!?!?!?)
> to develop with TOPLink (Glorp's ancestor) for quite a while so Glorp is
> somewhat familiar to me.  In that case, where's the current effort/version
> to develop Glorp for Pharo and which Pharo version is the preferred one for
> development/tests ?
>
> tia
>
> -
> Benoît St-Jean
> Yahoo! Messenger: bstjean
> Twitter: @BenLeChialeux
> Pinterest: benoitstjean
> Instagram: Chef_Benito
> IRC: lamneth
> Blogue: endormitoire.wordpress.com
> "A standpoint is an intellectual horizon of radius zero".  (A. Einstein)
>
>


Re: [Pharo-users] Glorp / SQLite3 issue

2016-06-11 Thread Alistair Grant
Hi Offray,

On Fri, Jun 10, 2016 at 09:37:58AM -0500, Offray Vladimir Luna C??rdenas wrote:
> On 09/06/16 23:39, Alistair Grant wrote:
> 
> [...]
> > 
> > I have seen one other problem with UDBC-SQLite3: if a connection is open
> > when the image is saved, it must be manually closed and re-opened after
> > the image is opened.  Should this be handled automatically?  If you
> > think this should be working I'll put together some code to reproduce
> > it.
> > 
> [...]
> 
> I experienced something similar with NBSQLite3 before. Now I'm always
> closing my connections explicitly, once I have the collected info of the
> query in a "report" object of Pharo. I don't know if this could work in your
> case. In mine, the Panama Papers project has this, for example:
> 
> ===
> OffshoresDB class>>totalOffshoresByCountryRaw
> "I query for the offshores by country data from a SQLite database file"
> | queryResults query |
> query := 'SELECT countries AS "country_name", count(countries) AS
> "total_offshores"
>  FROM Addresses
>  GROUP BY countries'.
> self dataLocation exists
> ifFalse: [ self inform: 'Download database first by running: ', String
> cr,
>  '"OffshoreLeaks updateDatabase"'  ]
> ifTrue: [
> queryResults := (self database open execute: query) rows collect: [
> :each | each data ].
> self database isOpen ifTrue: [ self database close ].
> ^ queryResults
> ]
> ===

Thanks for the suggestion.  I had tried this, however my application is
fairly interactive, and Glorp proxies require the session to be logged
in to operate correctly, so it doesn't work in my situation,
unfortunately.

I guess I'll write a startup script that closes and re-opens the session
(I don't want to have to close everything when saving an image).

Thanks again,
Alistair




Re: [Pharo-users] Glorp / SQLite3 issue

2016-06-09 Thread Alistair Grant
Hi Pierce,

On Thu, Jun 09, 2016 at 10:14:06PM +0800, Pierce Ng wrote:
> On Wed, Jun 08, 2016 at 08:25:27PM +0200, Alistair Grant wrote:
> > > asking the session to login results in the following:
> > > UDBCSQLite3Connection(Object)>>doesNotUnderstand: #queryEncoding
> > > PharoDatabaseAccessor>>encoding
> > > GlorpSession>>loginIfError:
> > > GlorpSession>>login
> > > GlorpBookDescriptorSystem class>>getSession
> > > UndefinedObject>>DoIt
> 
> Interesting. Meaning none of Glorp's ~900 tests sends #login to a session
> object directly...?
> 
> Ok, GlorpDatabaseLoginResource>>setUp looks like it asks the accessor to 
> login.
> 
> Transcript show: self class name asString, ' setUp'; cr.
> super setUp.
> self login: self class defaultLogin.
> accessor := DatabaseAccessor forLogin: login.
> accessor login. 
> 
> Looking around using Finder, seems this is how Glorp's test suite does
> the login.
> 
> Try the following. It works on my computer. :-) I don't have the example book
> descriptor, so I'm reusing the test suite's.
> 
> | workingDir dbName login accessor session |
> workingDir := SmalltalkImage current imagePath asFileReference parent 
> fullName, 
> FileSystem disk delimiter asString.
> dbName := 'sodbxtestu.db'.
> login := Login new
> database: UDBCSQLite3Platform new;
> host: workingDir;
> port: '';
> username: '';
> password: '';
> databaseName: dbName;
> yourself.
> PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
> accessor := PharoDatabaseAccessor forLogin: login.
> accessor login.
> [   session := GlorpSession new.
> session system: (GlorpDemoDescriptorSystem forPlatform: login 
> database).
> session accessor: accessor.
> session beginTransaction.
> session inUnitOfWorkDo: [  
> | table row |
> table := session system tableNamed: 'GR_ADDRESS'.
> row := DatabaseRow newForTable: table.
> row at: (table fieldNamed: 'ID') put: 1.
> row at: (table fieldNamed: 'STREET') put: 'Alpha'.
> row at: (table fieldNamed: 'HOUSE_NUM') put: '300'.   
> session writeRow: row ].
> session commitTransaction.
> ] ensure: [ accessor logout ]
> 
> After running the test suite, sodbxtestu.db contains the test schema but has 
> no
> data. After running the above snippet:
> 
> sqlite> select * from GR_ADDRESS;
> ID|STREET|HOUSE_NUM
> 1|Alpha|300
> sqlite> 
> 
> (The snippet is still low level, because it creates the DatabaseRow object
> explicitly.)
> 
> Just for kicks, I ran the snippet a second time and got this:
> 
> GlorpDatabaseWriteError: UNIQUE constraint failed: GR_ADDRESS.ID
> 
> 
> > UDBCSQLite3BaseConnection>>queryEncoding
> > ^#'utf-8'
> 
> If #queryEncoding is a Glorp-specific thing, then from an architectural purity
> perspective I prefer to not have this in UDBCSQLiteBaseConnection which is
> intended to be a thin layer over the SQLite C API.
> 
> Can you try the above method see if it works for you.

Yep, I get the same results (sodbxtestu.db is populated, and the
constraint error on 2nd attempt).

I've been able to define a couple of classes / tables with foreign keys
and it is all working fine.  I'm still to set up a many-to-many
relationship and the more complex queries, but it is all looking good so
far.

I have seen one other problem with UDBC-SQLite3: if a connection is open
when the image is saved, it must be manually closed and re-opened after
the image is opened.  Should this be handled automatically?  If you
think this should be working I'll put together some code to reproduce
it.


Thanks!
Alistair




Re: [Pharo-users] Glorp / SQLite3 issue

2016-06-09 Thread Pierce Ng
On Wed, Jun 08, 2016 at 08:25:27PM +0200, Alistair Grant wrote:
> > asking the session to login results in the following:
> > UDBCSQLite3Connection(Object)>>doesNotUnderstand: #queryEncoding
> > PharoDatabaseAccessor>>encoding
> > GlorpSession>>loginIfError:
> > GlorpSession>>login
> > GlorpBookDescriptorSystem class>>getSession
> > UndefinedObject>>DoIt

Interesting. Meaning none of Glorp's ~900 tests sends #login to a session
object directly...?

Ok, GlorpDatabaseLoginResource>>setUp looks like it asks the accessor to login.

Transcript show: self class name asString, ' setUp'; cr.
super setUp.
self login: self class defaultLogin.
accessor := DatabaseAccessor forLogin: login.
accessor login. 

Looking around using Finder, seems this is how Glorp's test suite does
the login.

Try the following. It works on my computer. :-) I don't have the example book
descriptor, so I'm reusing the test suite's.

| workingDir dbName login accessor session |
workingDir := SmalltalkImage current imagePath asFileReference parent 
fullName, 
FileSystem disk delimiter asString.
dbName := 'sodbxtestu.db'.
login := Login new
database: UDBCSQLite3Platform new;
host: workingDir;
port: '';
username: '';
password: '';
databaseName: dbName;
yourself.
PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
accessor := PharoDatabaseAccessor forLogin: login.
accessor login.
[   session := GlorpSession new.
session system: (GlorpDemoDescriptorSystem forPlatform: login database).
session accessor: accessor.
session beginTransaction.
session inUnitOfWorkDo: [  
| table row |
table := session system tableNamed: 'GR_ADDRESS'.
row := DatabaseRow newForTable: table.
row at: (table fieldNamed: 'ID') put: 1.
row at: (table fieldNamed: 'STREET') put: 'Alpha'.
row at: (table fieldNamed: 'HOUSE_NUM') put: '300'. 
session writeRow: row ].
session commitTransaction.
] ensure: [ accessor logout ]

After running the test suite, sodbxtestu.db contains the test schema but has no
data. After running the above snippet:

sqlite> select * from GR_ADDRESS;
ID|STREET|HOUSE_NUM
1|Alpha|300
sqlite> 

(The snippet is still low level, because it creates the DatabaseRow object
explicitly.)

Just for kicks, I ran the snippet a second time and got this:

GlorpDatabaseWriteError: UNIQUE constraint failed: GR_ADDRESS.ID


> UDBCSQLite3BaseConnection>>queryEncoding
>   ^#'utf-8'

If #queryEncoding is a Glorp-specific thing, then from an architectural purity
perspective I prefer to not have this in UDBCSQLiteBaseConnection which is
intended to be a thin layer over the SQLite C API.

Can you try the above method see if it works for you.

Pierce



Re: [Pharo-users] Glorp / SQLite3 issue

2016-06-08 Thread stepharo

Thanks Alistair

This is a great initiative. Documentation is our shared knowledge. I 
spent time editing the document


but I do not have time and the need for glorp now.

Stef


Le 8/6/16 à 09:50, Alistair Grant a écrit :

Hi All,

I'm working my way through some of the examples in
PharoInProgress/Glorp.  Adapting Pierce's code from his announcement:


| workingDir dbName login session |

workingDir := SmalltalkImage current imagePath asFileReference parent 
fullName
, FileSystem disk delimiter asString.
dbName := 'glorpbook.db'.
login := Login new
database: UDBCSQLite3Platform new;
host: workingDir;
port: '';
username: '';
password: '';
databaseName: dbName;
yourself.
PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
session := GlorpBookDescriptorSystem sessionForLogin: login.
session createTables.

However this fails with:

MessageNotUnderstood: receiver of "basicExecuteSQLString:" is nil

If I add a breakpoint in GlorpSession>>accessor: manually execute:

accessor login

and then proceed, everything works fine.

Given that Glorp has been around for so long, I guess that this is more
likely an issue with the new UDBC driver, however I don't yet understand
the architecture well enough to propose a fix.

Any suggestions?


Thanks!
Alistair







Re: [Pharo-users] Glorp / SQLite3 issue

2016-06-08 Thread Alistair Grant
On Wed, Jun 08, 2016 at 07:49:13PM +0200, Alistair Grant wrote:
> Hi Pierce,
> 
> On Wed, Jun 08, 2016 at 09:22:10PM +0800, Pierce Ng wrote:
> > On Wed, Jun 08, 2016 at 09:50:41AM +0200, Alistair Grant wrote:
> > >   PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
> > >   session := GlorpBookDescriptorSystem sessionForLogin: login.
> > 
> > Listing 1.12 on page 9 of the PDF says your code is missing a line:
> > 
> > session login.
> > 
> > The example I posted in the announcement thread also sends #login, but to 
> > the
> > accessor.
> > 
> >   | login accessor |
> >   login := Login new
> > ...
> > yourself.
> >   PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
> >   accessor := PharoDatabaseAccessor forLogin: login.
> > "==>"  accessor login. "<=="
> >   (accessor executeSQLString: 'select * from sqlite_master') explore.
> >   accessor logout.  
> > 
> > If you follow the implementation of GlorpSession>>login you will see that it
> > eventually sends #login to the accessor.
> > 
> > Pierce
> 
> 
> Thanks for your response.  You're right, and I had tried this, however
> asking the session to login results in the following:
> 
> UDBCSQLite3Connection(Object)>>doesNotUnderstand: #queryEncoding
> PharoDatabaseAccessor>>encoding
> GlorpSession>>loginIfError:
> GlorpSession>>login
> GlorpBookDescriptorSystem class>>getSession
> UndefinedObject>>DoIt
> 
> In my image at least, there are no implementers of #queryEncoding.

P.S.  If I add:

UDBCSQLite3BaseConnection>>queryEncoding

^#'utf-8'


I'm able to create tables and populate the database (which is as far as
I've got).  But of course, not sure if this is the appropriate solution.

Thanks!
Alistair




Re: [Pharo-users] Glorp / SQLite3 issue

2016-06-08 Thread Alistair Grant
Hi Pierce,

On Wed, Jun 08, 2016 at 09:22:10PM +0800, Pierce Ng wrote:
> On Wed, Jun 08, 2016 at 09:50:41AM +0200, Alistair Grant wrote:
> > PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
> > session := GlorpBookDescriptorSystem sessionForLogin: login.
> 
> Listing 1.12 on page 9 of the PDF says your code is missing a line:
> 
> session login.
> 
> The example I posted in the announcement thread also sends #login, but to the
> accessor.
> 
>   | login accessor |
>   login := Login new
> ...
> yourself.
>   PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
>   accessor := PharoDatabaseAccessor forLogin: login.
> "==>"  accessor login. "<=="
>   (accessor executeSQLString: 'select * from sqlite_master') explore.
>   accessor logout.  
> 
> If you follow the implementation of GlorpSession>>login you will see that it
> eventually sends #login to the accessor.
> 
> Pierce


Thanks for your response.  You're right, and I had tried this, however
asking the session to login results in the following:

UDBCSQLite3Connection(Object)>>doesNotUnderstand: #queryEncoding
PharoDatabaseAccessor>>encoding
GlorpSession>>loginIfError:
GlorpSession>>login
GlorpBookDescriptorSystem class>>getSession
UndefinedObject>>DoIt

In my image at least, there are no implementers of #queryEncoding.


Thanks!
Alistair



Re: [Pharo-users] Glorp / SQLite3 issue

2016-06-08 Thread Pierce Ng
On Wed, Jun 08, 2016 at 09:50:41AM +0200, Alistair Grant wrote:
>   PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
>   session := GlorpBookDescriptorSystem sessionForLogin: login.

Listing 1.12 on page 9 of the PDF says your code is missing a line:

session login.

The example I posted in the announcement thread also sends #login, but to the
accessor.

  | login accessor |
  login := Login new
...
yourself.
  PharoDatabaseAccessor DefaultDriver: GlorpSQLite3Driver.
  accessor := PharoDatabaseAccessor forLogin: login.
"==>"  accessor login. "<=="
  (accessor executeSQLString: 'select * from sqlite_master') explore.
  accessor logout.  

If you follow the implementation of GlorpSession>>login you will see that it
eventually sends #login to the accessor.

Pierce




Re: [Pharo-users] Glorp with PostgresV2 on Pharo 4

2015-04-04 Thread Pierce Ng
On Fri, Apr 03, 2015 at 07:20:40AM +0200, Sven Van Caekenberghe wrote:
 Yes, we have to fix that, but you also set it manually, no real need to patch
 the code:

Ok, wasn't sure what the encoding strategy should be. I'll patch
GlorpDatabaseLoginResource then. 

Pierce



Re: [Pharo-users] Glorp with PostgresV2 on Pharo 4

2015-04-02 Thread Sven Van Caekenberghe

 On 03 Apr 2015, at 06:58, Pierce Ng pie...@samadhiweb.com wrote:
 
 Now that we know the PostgresV2 driver can talk to our database, using the
 Monticello browser, open the PostgresV2 repository and load the package
 GlorpDriverPostgreSQL. Here I had to edit 
 NativePostgresDriverconnectionArgsFromCurrentLogin: to comment out
 the second last line:
 
connectionArgs clientEncoding: aLogin encodingStrategy asSymbol
 
 This is because GlorpDatabaseLoginResource classdefaultPostgreSQLLocalLogin 
 does not specify encodingStrategy, meaning it is nil and will respond 
 to #asSymbol with DNU.

Yes, we have to fix that, but you also set it manually, no real need to patch 
the code:

createLogin
  ^ Login new
  database: PostgreSQLPlatform new;
  username: 'sven';
  password: '';
  connectString: 'localhost:5432_sven';
  encodingStrategy: #utf8;
  yourself

Interesting articles !

Sven




Re: [Pharo-users] Glorp with NBSQLite3 on Pharo 4

2015-04-02 Thread Pablo R. Digonzelli
Excellent!!!

Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
San Miguel de Tucumán 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714

- Mensaje original -
De: Pierce Ng pie...@samadhiweb.com
Para: pharo-users@lists.pharo.org
Enviados: Jueves, 2 de Abril 2015 14:17:41
Asunto: [Pharo-users] Glorp with NBSQLite3 on Pharo 4

Hi all,

I've integrated NBSQLite3 into Glorp on the current Pharo v40592 beta image. 
Details in my blog post here: 

  http://www.samadhiweb.com/blog/

Pierce



Re: [Pharo-users] Glorp on Pharo 4

2015-01-24 Thread stepharo

Hi torsten

thanks for your energy and push!
People around me :) Olivier and Guille are planning their work on databases.
Guille started to hack an API.

Stef
Le 19/1/15 22:03, Torsten Bergmann a écrit :

Hi Craig,

I've Glorp working with Pharo 4 and NBSQlite3 now without any problem.
That's why it is now also in the config browser.

As you see from the repo I restructured a bit the Glorp package
to dig deeper into it and hopefully find the time updating the port
once I have access to the VW code. Will update the config in the next
available time slot.

According to Alan Glorp is now relicensed to MIT thanks to Nial Ross
and it would make sense to bring the Pharo port up to date.

Thanks
T.







Re: [Pharo-users] Glorp on Pharo 4

2015-01-22 Thread Craig
Sven,

It took a bit, but I figured it out.

If you try to login with a login that has previously been used, then you get
this DNU message.

I was following your reddit-st-in-10-cool-pharo-classes and it happened
when I ran the first test.
This was the second time that the DefaultLogin was used (it was lazily
initialised by the create tables call).
When I nill-ed out the DefaultLogin the tests all passed.

Craig


-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of
Sven Van Caekenberghe
Sent: 22 January 2015 10:19 AM
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] Glorp on Pharo 4

A comma is indeed a (binary) message. It concatenates two Collections, like
Strings.

Please provide more details on how you try to connect and what error you
get, exactly.

 On 22 Jan 2015, at 08:26, Craig cr...@hivemind.net wrote:
 
 From: Sven Van Caekenberghe
 Sent: 22 January 2015 08:37 AM
 
 What exactly do you mean ?
 
 Reading the link above that seems to be correct, at first glance, 
 maybe I
 don't see it.
 
 Sven,
 
 Forgive me, I'm new to Pharo, but I'm sure that in Pharo you don't use 
 commas to separate parameters in a message.  I don't know of any 
 syntactical significance of the comma.
 I saw this after I got the , does not understand connectionArgs 
 message when trying to connect to my Postgres database.  I take this 
 to mean that Pharo tried to send the connectionArgs message to the ',' 
 ByteString.
 
 Craig
 
 





Re: [Pharo-users] Glorp on Pharo 4

2015-01-21 Thread Craig
From:  Sven Van Caekenberghe
Sent: 20 January 2015 01:40 PM

 Using Glorp on top of the PostgresV2 driver (which uses just a network
connection and no native code nor plugin) 
 should work on all platforms. Of course, you still have to install
Postgres itself, but it can run on another machine too.

 HTH,

 Sven
Sven,

I just ran into an issue in the Postgres V2 driver, which I guess is a
porting error.  See below and note the commas ,.

PGConnectionstSendingMD5Password: event 
MD5 authentication as explain in
http://archives.postgresql.org/pgsql-novice/2003-05/msg00305.php;
| hashedCredentials hashedMessage |

hashedCredentials := (MD5 hashMessage: (connectionArgs password,
connectionArgs userName)) hex asLowercase.
hashedMessage := 'md5', (MD5 hashMessage: (hashedCredentials, event
salt asString)) hex asLowercase.

selfsendPacket: (PGPasswordPacket password: hashedMessage) on:
socket.




Re: [Pharo-users] Glorp on Pharo 4

2015-01-21 Thread Sven Van Caekenberghe

 On 22 Jan 2015, at 06:52, Craig cr...@hivemind.net wrote:
 
 From:  Sven Van Caekenberghe
 Sent: 20 January 2015 01:40 PM
 
 Using Glorp on top of the PostgresV2 driver (which uses just a network
 connection and no native code nor plugin) 
 should work on all platforms. Of course, you still have to install
 Postgres itself, but it can run on another machine too.
 
 HTH,
 
 Sven
 Sven,
 
 I just ran into an issue in the Postgres V2 driver, which I guess is a
 porting error.  See below and note the commas ,.
 
 PGConnectionstSendingMD5Password: event 
   MD5 authentication as explain in
 http://archives.postgresql.org/pgsql-novice/2003-05/msg00305.php;
   | hashedCredentials hashedMessage |
 
   hashedCredentials := (MD5 hashMessage: (connectionArgs password,
 connectionArgs userName)) hex asLowercase.
   hashedMessage := 'md5', (MD5 hashMessage: (hashedCredentials, event
 salt asString)) hex asLowercase.
 
   selfsendPacket: (PGPasswordPacket password: hashedMessage) on:
 socket.

What exactly do you mean ?

Reading the link above that seems to be correct, at first glance, maybe I don't 
see it.

Sven




Re: [Pharo-users] Glorp on Pharo 4

2015-01-21 Thread Craig
From: Sven Van Caekenberghe
Sent: 22 January 2015 08:37 AM

 What exactly do you mean ?

 Reading the link above that seems to be correct, at first glance, maybe I
don't see it.

Sven,

Forgive me, I'm new to Pharo, but I'm sure that in Pharo you don't use
commas to separate parameters in a 
message.  I don't know of any syntactical significance of the comma.
I saw this after I got the , does not understand connectionArgs message
when trying to connect to my 
Postgres database.  I take this to mean that Pharo tried to send the
connectionArgs message to the 
',' ByteString.

Craig




Re: [Pharo-users] Glorp on Pharo 4

2015-01-20 Thread Craig
Thanks Torsten,

The guide worked right out of the box.

Many thanks for your help.

Craig

-Original Message-
From: Torsten Bergmann [mailto:asta...@gmx.de] 
Sent: 20 January 2015 11:42 AM
To: cr...@hivemind.net; Any question about pharo is welcome
Subject: Glorp on Pharo 4

Hi Craig,

see below a quick guide. Tell me when it works.
Someone should do a video from that...
 
Thanks
Torsten


For Windows:

- go to http://www.sqlite.org/download.html and retrieve 
sqlite-dll-win32-x86-3080800.zip
- copy the included sqlite3.dll to the folder where your virtual machine 
(Pharo.exe) resides so it can be found by the NativeBoost wrapper later
  (as an alternative you can have in any folder that is accessible via PATH 
environment variable)

- open a fresh Pharo4.0 image (here I use latest update: #40451 image)
- load from ConfigurationBrowser: Glorp
- load from ConfigurationBrowser: NBSQLite3
- then open Monticello browser and select the repo for NBSQLite3, open it and
  load additionally NBSQLite3-Glorp-TorstenBergmann.3
- create a package Killerapp-Core using Nautilus system browser
- create a tag Model in this new package using Nautilus system browser
- create a class 
 
  Object subclass: #KillerAppUser
 instanceVariableNames: 'id username'
 classVariableNames: ''
 category: 'Killerapp-Core-Model'
 
- click on the class in Nautilus browser and select Refactoring - Class 
Refactoring
  and Generate Accessors to create accessor methods for the instance variables

- create a package Killerapp-Persistence using Nautilus system browser
- create a tag Mappings in this new package using Nautilus system browser

  DescriptorSystem subclass: #KillerAppDatabaseDescriptor
   instanceVariableNames: ''
   classVariableNames: ''
   category: 'Killerapp-Persistence-Mappings'

- implement an instance side method in method category 'accessing'

allTableNames
 ^ #('KILLERAPP_USER')  
   
- create an instance side method in category 'mapping-classes'

   constructAllClasses
  ^ super constructAllClasses
  add: KillerAppUser;
  yourself
  
  
- implement an instance side method in method category 'mapping - classes'

classModelForKillerAppUser: aClassModel
#(#id #username) do: [ :each |
aClassModel newAttributeNamed: each ]   
  
- create an instance side method in method category 'mapping - descriptors'

   descriptorForKillerAppUser: aDescriptor

  | table |
  table := self tableNamed: 'KILLERAPP_USER'.
  aDescriptor table: table.
  #(id username) do: [ :each |
(aDescriptor newMapping: DirectMapping) 
from: each to: (table fieldNamed: each) 
]


- implement an instance side method in method category 'mapping - tables'

tableForKILLERAPP_USER: aTable
Define the table KILLERAPP_USER
(aTable createFieldNamed: 'ID' type: platform sequence) 
isUnique: true; 
bePrimaryKey.   
(aTable createFieldNamed: 'USERNAME' type: (platform varchar: 
20))
isUnique: true;
beNullable: false.  

By having the descriptions set up you can now play with Glorp:

   |login accessor session|
   login := Login new.
   login host: ''.
   login databaseName: 'C:\db\killerapp.db'.
   login database: SQLite3Platform new.
   accessor := NBSQLite3DatabaseAccessor forLogin: login.
   accessor loginIfError: [ self error: 'unable to connect' ].
   session := GlorpSession new.
   session system: (KillerAppDatabaseDescriptor forPlatform: login database).
   session accessor: accessor.

   Create all tables (only to be done once)
   session createTables.

   Create a new user
   session inUnitOfWorkDo: [ 
  user := (KillerAppUser new)
  username: 'admin'.
  session register: user ].

Then you can use a tool like SQLiteStudio to open the database and check what 
is in the tables...







Re: [Pharo-users] Glorp on Pharo 4

2015-01-20 Thread Sven Van Caekenberghe
Hi Craig,

 On 19 Jan 2015, at 13:02, Craig cr...@hivemind.net wrote:
 
 Hi All,
 
 I see that Sven is active on this list.  I've tried to use his excellent
 tutorial on his concerning-pharo blog to understand Glorp and to get my
 own instance of the demo app running on Pharo 4 and Postgres.
 
 I have not burnt a lot of time on this yet, but I would like to know if this
 combination of technologies is known to work anywhere.  I have not yet got
 it working.
 
 Craig

Using Glorp on top of the PostgresV2 driver (which uses just a network 
connection and no native code nor plugin) should work on all platforms. Of 
course, you still have to install Postgres itself, but it can run on another 
machine too.

HTH,

Sven




Re: [Pharo-users] Glorp on Pharo 4

2015-01-20 Thread Craig


-Original Message-
From: Sven Van Caekenberghe
Sent: 20 January 2015 01:40 PM


Hi Sven,

 Using Glorp on top of the PostgresV2 driver (which uses just a network
connection 
 and no native code nor plugin) should work on all platforms. Of course,
you still
 have to install Postgres itself, but it can run on another machine too.

Thanks for the pointer.  It took quite a bit of scratching around, but I now
have a working 
Postgres Glorp driver, so I can use either RDBMS.

Thank-you for taking the trouble to respond to my questions.

Craig




Re: [Pharo-users] Glorp on Pharo 4

2015-01-19 Thread Craig
Torsten,

Can you tell me which packages you needed, and what you did  to get this 
working?  I've been trying to get it working with Postgres, but I'm not married 
to the database engine.

Craig

-Original Message-
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Torsten Bergmann
Sent: 19 January 2015 11:04 PM
To: Any question about pharo is welcome
Subject: [Pharo-users] Glorp on Pharo 4

Hi Craig,

I've Glorp working with Pharo 4 and NBSQlite3 now without any problem.
That's why it is now also in the config browser.

As you see from the repo I restructured a bit the Glorp package t to conn dig 
deeper into it and hopefully find the time updating the port once I have access 
to the VW code. Will update the config in the next available time slot.

According to Alan Glorp is now relicensed to MIT thanks to Nial Ross and it 
would make sense to bring the Pharo port up to date.

Thanks
T.




Re: [Pharo-users] Glorp + NBSQLite3

2014-10-06 Thread Pierce Ng
On Fri, Oct 03, 2014 at 10:44:43PM +0200, stepharo wrote:
 Cool what is NBSQLite3 (a nativeboost version)? Nice. Would be nice
 once you API stabilize that we get a chapter or on NBSQLite3 :)

Yes, NativeBoost interface to SQLite. Yes, I plan to write a chapter
on it. :-)

Pierce



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-06 Thread Pierce Ng
On Fri, Oct 03, 2014 at 09:19:15PM -0700, Sanjay-M wrote:
 I was wondering if this approach could be adopted in developing a
 Client/Server application with a separate server component accessing the
 SQLite database (on a separate machine).

Using HTTP/S as the client-server protocol, have the web app server manage 
data persistence, be it SQLite, GOODS or Gemstone, ...?

Pierce



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-06 Thread Sanjay-M
I am thinking of situations where we cannot have a web server even on the
intranet - more like traditional servers accessed over TCP/IP



-
---
Regards, Sanjay
--
View this message in context: 
http://forum.world.st/Glorp-NBSQLite3-tp4779996p4782972.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-06 Thread Esteban A. Maringolo
Sanjay-M s...@planage.com wrote:

 I was wondering if this approach could be adopted in developing a
 Client/Server application with a separate server component accessing the
 SQLite database (on a separate machine).

 If a template / model can be developed i am sure this can be very useful in
 creating larger multi-user applications even at the cost of some duplication
 / redundant effort.

 I am thinking of situations where we cannot have a web server even on the
 intranet - more like traditional servers accessed over TCP/IP

Sorry but I can't follow your question.

SQLite is a file based RDBMS engine, designed to be accessed locally
and not through TCP/IP.

If what you need to do is run over a network PostgreSQL will provide
you with such feature (plus a lot others).

Remember:
“SQLite is not a replacement for PostgreSQL [or any other RDBMS].
SQLite is a replacement for fopen().”


Regards.

Esteban A. Maringolo



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-06 Thread Esteban A. Maringolo
Pierce,

Thank you for the answers.

Is the wrapper thread safe?

I understan the library is thread-safe per se (at least in
Android+Java it is), so using the wrapper in Pharo (single-threaded at
the OS level) wouldn't cause issues. But I don't know how NativeBoost
plays here.

Regards!


Esteban A. Maringolo


2014-09-25 13:40 GMT-03:00 Pierce Ng pie...@samadhiweb.com:
 On Wed, Sep 24, 2014 at 01:33:02PM -0300, Esteban A. Maringolo wrote:
 How does SQLite scale in terms of table size and so on?

 According to https://www.sqlite.org/whentouse.html:

 An SQLite database is limited in size to 140 terabytes (2^47 bytes, 128
 tibibytes). And even if it could handle larger databases, SQLite stores the
 entire database in a single disk file and many filesystems limit the maximum
 size of files to something less than this.

 SQLite will normally work fine as the database backend to a website. But 
 if
 you website is so busy that you are thinking of splitting the database
 component off onto a separate machine, then you should definitely consider
 using an enterprise-class client/server database engine instead of SQLite.


 I was surprised to know it is based on an old version of PostgreSQL
 according to this presentation:
 http://www.pgcon.org/2014/schedule/events/736.en.html

 That is a very interesting talk. As it says, SQLite is a replacement for
 fopen(), not a replacement for PostgreSQL. In the context of my writing tools
 and applications in Smalltalk, I'd like to enjoy SQLite's robustness, hence
 my interest in having/building a good Smalltalk wrapper.

 Pierce





Re: [Pharo-users] Glorp + NBSQLite3

2014-10-06 Thread Sanjay-M
what I was saying was supposing we write a server that alone only accesses
the SQLite database. Users behave like clients accessing the server over
TCP/IP.

and the text i pointed to in my earlier mail detailed how such a scenario
could be implemented.

If someone could write a small sample with say one class then it could be
easier to understand / implement 



-
---
Regards, Sanjay
--
View this message in context: 
http://forum.world.st/Glorp-NBSQLite3-tp4779996p4783001.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-06 Thread Esteban A. Maringolo
2014-10-06 14:11 GMT-03:00 Sanjay-M s...@planage.com:
 what I was saying was supposing we write a server that alone only accesses
 the SQLite database. Users behave like clients accessing the server over
 TCP/IP.
 and the text i pointed to in my earlier mail detailed how such a scenario
 could be implemented.
 If someone could write a small sample with say one class then it could be
 easier to understand / implement

But that has nothing to do with SQLite nor any other persistence solution.
In fact most web applications work that way, where the messaging runs
over HTTP (and hence TCP/IP) and the server responds to them.
NBSQLite3 is a good solution for self contained applications, where
you can distribute everything without requiring the
installation/configuration of any third party DB server.

If you can't have a web server in your network environment (i.e.
intranet/LAN) how will you have any other TCP/IP based server?
I mean, if you want to run a Pharo image as your server tier, unless
you have certain port/policies restrictions, it will make no
difference whether you run an HTTP server or your [put your custom
protocol here] server.

Regards!



Re: [Pharo-users] Glorp + NBSQLite3

2014-10-03 Thread stepharo


On 24/9/14 18:17, Pierce Ng wrote:

Hello,

I am pleased to report that I have gotten Glorp working with NBSQLite3
enough to run Sven's Reddit.st.


Cool what is NBSQLite3 (a nativeboost version)? Nice. Would be nice once 
you API stabilize that

we get a chapter or on NBSQLite3 :)


As mentioned in my blog post, there is more work to be done to get
Glorp fully integrated with NBSQLite3, but preliminary results are
encouraging.

   http://www.samadhiweb.com/blog/2014.09.24.glorp.nbsqlite3.html

Pierce








Re: [Pharo-users] Glorp + NBSQLite3

2014-10-03 Thread Sanjay-M
There is a discussion on developing client/server in Dolphin Smalltalk's
online documentation
http://www.object-arts.com/downloads/docs/index.html - Appendix B -
Application Patterns - New Application #consequences.

I was wondering if this approach could be adopted in developing a
Client/Server application with a separate server component accessing the
SQLite database (on a separate machine).

If a template / model can be developed i am sure this can be very useful in
creating larger multi-user applications even at the cost of some duplication
/ redundant effort.

Regards
Sanjay



-
---
Regards, Sanjay
--
View this message in context: 
http://forum.world.st/Glorp-NBSQLite3-tp4779996p4782468.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Glorp + NBSQLite3

2014-09-25 Thread Pierce Ng
On Wed, Sep 24, 2014 at 01:33:02PM -0300, Esteban A. Maringolo wrote:
 How does SQLite scale in terms of table size and so on?

According to https://www.sqlite.org/whentouse.html:

An SQLite database is limited in size to 140 terabytes (2^47 bytes, 128
tibibytes). And even if it could handle larger databases, SQLite stores the
entire database in a single disk file and many filesystems limit the maximum
size of files to something less than this. 

SQLite will normally work fine as the database backend to a website. But if
you website is so busy that you are thinking of splitting the database
component off onto a separate machine, then you should definitely consider
using an enterprise-class client/server database engine instead of SQLite.


 I was surprised to know it is based on an old version of PostgreSQL
 according to this presentation:
 http://www.pgcon.org/2014/schedule/events/736.en.html

That is a very interesting talk. As it says, SQLite is a replacement for
fopen(), not a replacement for PostgreSQL. In the context of my writing tools
and applications in Smalltalk, I'd like to enjoy SQLite's robustness, hence
my interest in having/building a good Smalltalk wrapper.

Pierce




Re: [Pharo-users] Glorp + NBSQLite3

2014-09-24 Thread Esteban A. Maringolo
This is really cool!

How does SQLite scale in terms of table size and so on?

I was surprised to know it is based on an old version of PostgreSQL
according to this presentation:
http://www.pgcon.org/2014/schedule/events/736.en.html

Regards!
Esteban A. Maringolo


2014-09-24 13:17 GMT-03:00 Pierce Ng pie...@samadhiweb.com:
 Hello,

 I am pleased to report that I have gotten Glorp working with NBSQLite3
 enough to run Sven's Reddit.st.

 As mentioned in my blog post, there is more work to be done to get
 Glorp fully integrated with NBSQLite3, but preliminary results are
 encouraging.

   http://www.samadhiweb.com/blog/2014.09.24.glorp.nbsqlite3.html

 Pierce





Re: [Pharo-users] glorp

2014-05-21 Thread Esteban A. Maringolo
Pablo,

I'm using GLORP for two of my projects, with the Native PostgresV2 driver.
It is super solid, but still has some gotchas. Additionally, Pharo's version
isn't the latest.

Ask anything you need. GLORP can be really frustrating in the beginning.

Regards,

Esteban A. Maringolo


2014-05-21 1:15 GMT-03:00 Pablo R. Digonzelli pdigonze...@gmail.com:
 Hi all, where can i get updated info about glorp ?.
 Is someone using GLORP in a real business app?

 Tia

 
 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714




Re: [Pharo-users] glorp

2014-05-21 Thread Pablo R. Digonzelli
thanks all!.

I am going to do some experience with glorp and shure i will ask you lot of 
things.




Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 

- Mensaje original -
De: Esteban A. Maringolo emaring...@gmail.com
Para: Any question about pharo is welcome pharo-users@lists.pharo.org
Enviados: Miércoles, 21 de Mayo 2014 9:54:24
Asunto: Re: [Pharo-users] glorp

Pablo,

I'm using GLORP for two of my projects, with the Native PostgresV2 driver.
It is super solid, but still has some gotchas. Additionally, Pharo's version
isn't the latest.

Ask anything you need. GLORP can be really frustrating in the beginning.

Regards,

Esteban A. Maringolo


2014-05-21 1:15 GMT-03:00 Pablo R. Digonzelli pdigonze...@gmail.com:
 Hi all, where can i get updated info about glorp ?.
 Is someone using GLORP in a real business app?

 Tia

 
 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714





Re: [Pharo-users] glorp

2014-05-21 Thread Pablo R. Digonzelli
Esteban hi, are you using glorp or glorp-dbx thing?

TIA


Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 

- Mensaje original -
De: Pablo R. Digonzelli pdigonze...@gmail.com
Para: Any question about pharo is welcome pharo-users@lists.pharo.org
Enviados: Miércoles, 21 de Mayo 2014 11:03:22
Asunto: Re: [Pharo-users] glorp

thanks all!.

I am going to do some experience with glorp and shure i will ask you lot of 
things.




Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 

- Mensaje original -
De: Esteban A. Maringolo emaring...@gmail.com
Para: Any question about pharo is welcome pharo-users@lists.pharo.org
Enviados: Miércoles, 21 de Mayo 2014 9:54:24
Asunto: Re: [Pharo-users] glorp

Pablo,

I'm using GLORP for two of my projects, with the Native PostgresV2 driver.
It is super solid, but still has some gotchas. Additionally, Pharo's version
isn't the latest.

Ask anything you need. GLORP can be really frustrating in the beginning.

Regards,

Esteban A. Maringolo


2014-05-21 1:15 GMT-03:00 Pablo R. Digonzelli pdigonze...@gmail.com:
 Hi all, where can i get updated info about glorp ?.
 Is someone using GLORP in a real business app?

 Tia

 
 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714






Re: [Pharo-users] glorp

2014-05-21 Thread Pablo R. Digonzelli
Thanks!


Ing. Pablo Digonzelli 
Software Solutions 
IP-Solutiones SRL 
Metrotec SRL 
25 de Mayo 521 
Email: pdigonze...@softsargentina.com 
pdigonze...@gmail.com 
Cel: 5493815982714 

- Mensaje original -
De: Esteban A. Maringolo emaring...@gmail.com
Para: Any question about pharo is welcome pharo-users@lists.pharo.org
Enviados: Miércoles, 21 de Mayo 2014 15:17:41
Asunto: Re: [Pharo-users] glorp

They are the same thing... but the naming confuses everyone :D

I'm loading this:

spec repository: 'http://smalltalkhub.com/mc/DBXTalk/Glorp/main'.
spec package: 'Glorp'.
spec package: 'GlorpPharoCompatibility' with: [ spec requires: 'Glorp' ].
spec package: 'GlorpTests' with: [ spec requires: 'Glorp' ].

spec repository: 'http://www.smalltalkhub.com/mc/PharoExtras/PostgresV2/main'.
spec package: 'GlorpDriverPostgreSQL' with: [ spec requires: 'Glorp' ].

Regards,

Esteban A. Maringolo


2014-05-21 15:06 GMT-03:00 Pablo R. Digonzelli pdigonze...@gmail.com:
 Esteban hi, are you using glorp or glorp-dbx thing?

 TIA


 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714

 - Mensaje original -
 De: Pablo R. Digonzelli pdigonze...@gmail.com
 Para: Any question about pharo is welcome pharo-users@lists.pharo.org
 Enviados: Miércoles, 21 de Mayo 2014 11:03:22
 Asunto: Re: [Pharo-users] glorp

 thanks all!.

 I am going to do some experience with glorp and shure i will ask you lot of 
 things.




 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714

 - Mensaje original -
 De: Esteban A. Maringolo emaring...@gmail.com
 Para: Any question about pharo is welcome pharo-users@lists.pharo.org
 Enviados: Miércoles, 21 de Mayo 2014 9:54:24
 Asunto: Re: [Pharo-users] glorp

 Pablo,

 I'm using GLORP for two of my projects, with the Native PostgresV2 driver.
 It is super solid, but still has some gotchas. Additionally, Pharo's version
 isn't the latest.

 Ask anything you need. GLORP can be really frustrating in the beginning.

 Regards,

 Esteban A. Maringolo


 2014-05-21 1:15 GMT-03:00 Pablo R. Digonzelli pdigonze...@gmail.com:
 Hi all, where can i get updated info about glorp ?.
 Is someone using GLORP in a real business app?

 Tia

 
 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714








Re: [Pharo-users] glorp

2014-05-20 Thread Clément Bera
Hello,

2014-05-21 6:15 GMT+02:00 Pablo R. Digonzelli pdigonze...@gmail.com:

 Hi all, where can i get updated info about glorp ?.


don't know


 Is someone using GLORP in a real business app?


Yes, they are using it with DBXTalk to bind relational databases.

People with more knowledge about that can answer you on Pharo-business
mailing list.



 Tia

 --
 *Ing. Pablo Digonzelli*
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714




Re: [Pharo-users] glorp

2014-05-20 Thread jtuc...@objektfabrik.de

Hi Pablo,

I guess the best way to get recent info on Glorp is to see if there is 
an updated piece of documentation shipping with the latest version of 
VisualWorks from Cincom.


We do use Glorp for our accounting service for German businesses 
(www.kontolino.de). We're running on VA Smalltalk under Linux and are 
using DB2. We've had a few issues in the past that were either related 
to the VA ST port of Glorp and could be fixed by us or together with 
INstantiations, or, if they were bugs in base Glorp, were fixed by Niall 
and integrated into newer versions. So far I must say I am happy with 
Glorp. It does its job nicely and reliably, and once you accept the 
implications of O/R mapping (aka Impedance mismatch), you can do a lot 
with it.

We also use Glorp for projects that I can not publicly talk about.

There is a Glorp-related discussion Group on Google Groups: 
https://groups.google.com/forum/#!forum/glorp-group


hth

Joachim

--
---
Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1




Re: [Pharo-users] glorp

2014-04-26 Thread jtuc...@objektfabrik.de

Sven,

Am 25.04.14 22:44, schrieb Sven Van Caekenberghe:


But one of his points was that ORM layers made SQL obsolete by hiding much of 
its power, the ability to do (query and other) processing on the DB.
Hmm. I think what the article said was that you give up much of the 
power and flexibility of SQL by using ORMs, but not that SQL was thereby 
obsoleted. You give up on much of the power of SQL, but you also get a 
lot of work done for you on the object side.


Plus, you can always issue SQL statements to the database if you need 
to. Of course you need to be aware that what you are doing could 
undermine the bookkeeping of the ORM layer. Glorp, as an example, can 
also build very sophisticated queries for object retrieval, like 
subqueries, outer joins and whatnot. I am only slowly learning about the 
power that's buried in there. So you can in fact use (a good portion of) 
the power of SQL in GLORP for object lookup. And you can choose to 
bypass it for special cases where you want to use SQL directly. You are 
wandering between two worlds then, but you can if you need to.




BTW, I don't think there is such a thing as transparent persistency.
  

I came to the same conclusion. The most transparent-y thing I can think 
of is saving an image. Of course there is no ACID in it. Maybe Gemstone 
is almost as close to it, but only as long as you are not using very 
large Collections and stuff, because then you need to program for it 
(even if it seems to be relatively straightforward).


Joachim





Re: [Pharo-users] glorp

2014-04-25 Thread Norbert Hartl


 Am 25.04.2014 um 06:51 schrieb Joachim Tuchel jtuc...@objektfabrik.de:
 
 Hi,
 
 We're using Glorp on VA ST for kontolino.de. It is an active project in the 
 sense of somebody is taking care of bugs. The lead developer(s) work(s) for 
 Cincom - and Cincom uses Glorp as supported component of CST. Instantiations 
 also provides Glorp with VA ST and supports it. Glorp is very stable and is 
 not moving fast, which is not a disadvantage for a production system. 
 Features are being added and bugs are fixed.
 
 Re: Pharoers do NoSQL: judging from the discussions on this list and others, 
 you have to be careful what you need. To me it seems many developers want 
 features from relational DBs and hammer them into their applications with 
 brute force. The first wow! soon gives room to a lot of problems that have 
 been solved in relational DBs three decades ago.
 
I think such a statement should be based on an example. 

 But it is true that o/r mapping is not always fun. It can force you to make 
 decisions about your model that look strange from the object perspective.
 
Agreed. And especially in the context of O/R I'm curious what will be your 
example to prove your point above.

Couldn't resist,

Norbert
 I'd either go full objects (gemstone, magma) or relational for my typical 
 projects (business apps).
 
 Hth
 
 Joachim
 
 Clément Bera bera.clem...@gmail.com schrieb:
 
 Hello,
 
 I think Glorp is used with DBXTalk for relational databases by multiple 
 people.
 
 Usually, with Pharo, people use as a persistance layer either MongoDB with 
 the frameworks MongoTalk/Voyage.
 
 Gemstone is also used quite often for large scale application but Gemstone is 
 not free.
 
 Regards.
 
 
 2014-04-23 20:34 GMT-07:00 Pablo R. Digonzelli pdigonze...@gmail.com:
 Hi all, can someone tell me if glorp is active there ar is using glorp or 
 other persistence framework in production projects?
 
 Tia
 
 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714
 
 


Re: [Pharo-users] glorp

2014-04-25 Thread jtuc...@objektfabrik.de

Norbert,

you are right, I should have given an example of what I mean.

So here is one:

If you serialize an object graph to, say, json and store it in a NoSQL 
DB, you need to decide how deep you serialize your graph into one 
djson document and how to build up segments of your graph that need to 
be serialized separately, like for an equivalent of an 1:n relationship. 
Exanple: an Order contains OrderItems, each of which reference a 
Product. But the Product can be referenced from many OrderItems. So you 
need to cut off parts of your model to serialize them separately. And 
you need a way to save the reference.


One of the next questions then is what if I delete a Product?. What 
happens to the OrderItems or InvoiceItems and so on?


None of these problems are unsolvable, but these problems need to be 
addressed either in your persistence framework on top of a NoSQl DB or 
in your application code. In Relational DBs, they've built solutions for 
these problems before you and I were born ;-) I am talking of foreign 
keys, referential integrities and normalization. To my knowledge, these 
have not yet found their standardized counterparts in NoSQL DBs. So 
NoSQL can be a good solution for many problems, but they can also be bad 
for many others.


I am not saying anything new here. This debate has been going on for 
decades already, and much more clever people than me have made good 
points for both sides over the years now.


You also asked for examples for problems you get from using Glorp.

One of my biggest concerns is that it can be hard to model an m:n 
relationship where one or both sides of the relationship are abstract 
superclasses (or even concrete ones with multiple subclasses). It gets 
even harder when you want to be able to associate an object (like a 
Category or Tag) to anything. This really is hard or involves some 
additional coding on top of the persistence framework.


Glorp does miss one feature painfully: The ability to map classes with 
subclasses that spread over three or more subtables for the 
subclasses. This one is hard to explain: if you have a superclass 
Vehicle with two subclasses FlyingVehicle and DrivingVehicle, both 
of which have subclasses, there is no support for a model which has 
tables on the FlyingVehicle or DrivingVehicle level. You must model 
your DB in a way that there are all attributes in a Vehicle table or 
in the Car, Train, Spaceship and Kite tables. This really is a 
pity and I don't think anybody is working on changing this any time soon.


Does this explain what I mean?

Joachim







Am 25.04.14 08:41, schrieb Norbert Hartl:



Am 25.04.2014 um 06:51 schrieb Joachim Tuchel jtuc...@objektfabrik.de 
mailto:jtuc...@objektfabrik.de:



Hi,

We're using Glorp on VA ST for kontolino.de http://kontolino.de. It 
is an active project in the sense of somebody is taking care of bugs. 
The lead developer(s) work(s) for Cincom - and Cincom uses Glorp as 
supported component of CST. Instantiations also provides Glorp with 
VA ST and supports it. Glorp is very stable and is not moving fast, 
which is not a disadvantage for a production system. Features are 
being added and bugs are fixed.


Re: Pharoers do NoSQL: judging from the discussions on this list and 
others, you have to be careful what you need. To me it seems many 
developers want features from relational DBs and hammer them into 
their applications with brute force. The first wow! soon gives room 
to a lot of problems that have been solved in relational DBs three 
decades ago.



I think such a statement should be based on an example.

But it is true that o/r mapping is not always fun. It can force you 
to make decisions about your model that look strange from the object 
perspective.


Agreed. And especially in the context of O/R I'm curious what will be 
your example to prove your point above.


Couldn't resist,

Norbert
I'd either go full objects (gemstone, magma) or relational for my 
typical projects (business apps).


Hth

Joachim

Clément Bera bera.clem...@gmail.com mailto:bera.clem...@gmail.com 
schrieb:


Hello,

I think Glorp is used with DBXTalk for relational databases by 
multiple people.


Usually, with Pharo, people use as a persistance layer either MongoDB 
with the frameworks MongoTalk/Voyage.


Gemstone is also used quite often for large scale application but 
Gemstone is not free.


Regards.


2014-04-23 20:34 GMT-07:00 Pablo R. Digonzelli pdigonze...@gmail.com 
mailto:pdigonze...@gmail.com:


Hi all, can someone tell me if glorp is active there ar is using
glorp or other persistence framework in production projects?

Tia



*Ing. Pablo Digonzelli*
Software Solutions
IP-Solutiones SRL
Metrotec SRL
25 de Mayo 521
Email: pdigonze...@softsargentina.com
mailto:pdigonze...@softsargentina.com
pdigonze...@gmail.com mailto:pdigonze...@gmail.com
Cel: 

Re: [Pharo-users] glorp

2014-04-25 Thread Norbert Hartl
Joachim,

thanks for your explanation. I appreciate that. I was thinking if it is a good 
idea to write my mail. Usually this ends in a holy war which I don’t want. 
Comments inline.

Am 25.04.2014 um 09:02 schrieb jtuc...@objektfabrik.de:

 Norbert,
 
 you are right, I should have given an example of what I mean. 
 
 So here is one:
 
 If you serialize an object graph to, say, json and store it in a NoSQL DB, 
 you need to decide how deep you serialize your graph into one djson 
 document and how to build up segments of your graph that need to be 
 serialized separately, like for an equivalent of an 1:n relationship. 
 Exanple: an Order contains OrderItems, each of which reference a Product. But 
 the Product can be referenced from many OrderItems. So you need to cut off 
 parts of your model to serialize them separately. And you need a way to save 
 the reference“.

You can do that in e.g. mongo as well. You just use on ObjectId as a field 
value or you use a DBRef. Btw. what you describe is not 1:n but m:n. An 
OrderItems can have n products and a Product can be in m OrderItems. 
 
 One of the next questions then is what if I delete a Product?. What happens 
 to the OrderItems or InvoiceItems and so on?

If you just delete it the collections will have a stale reference. I think 
there is no universal answer to that even if it seems the removal in the 
collection is that universal answer. If it is about integrity you need one way 
to make it happen. Reestablishing of integrity can happen on write time or on 
read time. 
What will happen in a SQL context? You can’t delete an object that is pointed 
to by a foreign key. What does it help then? Not taking your business model 
into account you couldn’t do anything more to find out where that reference is. 
That is probably the only point I wanted to make questioning your last mail. If 
we take that scenario you can only solve it if you take the problem one level 
higher (well, if you have cascading deletes you may ignore it). So these 
problems tend to end in the application logic. And that is what my experience 
tells me. Database ensured integrity isn’t much of a help in many cases. So you 
solve the problems in the application logic (knowing which things reference 
what). Being there I see no big differences to using a NoSQL database. In NoSQL 
those features are just not there per se. You have to model it regarding your 
use case. 

 None of these problems are unsolvable, but these problems need to be 
 addressed either in your persistence framework on top of a NoSQl DB or in 
 your application code. In Relational DBs, they've built solutions for these 
 problems before you and I were born ;-) I am talking of foreign keys, 
 referential integrities and normalization. To my knowledge, these have not 
 yet found their standardized counterparts in NoSQL DBs. So NoSQL can be a 
 good solution for many problems, but they can also be bad for many others. 

I’m questioning the use of each of those. As I said above I doubt there are 
many use cases where foreign keys are the best way to go. Btw. if you ever 
administrate a database and you have to recover after a crash then you might 
have a different view on foreign keys because they are able to make it close to 
impossible to load the data back.  Referential integrity is either done by the 
database by foreign keys or in the application logic as I said above. The need 
for normalization is heavily use case depend. It is nothing good per se. So 
these are not good examples IMHO. I’m wondering you didn’t bring up the only 
good reason for SQL databases (for most). For me this is having atomic 
operations using transactions. This is the one case that can drive you nuts if 
try to model something with a NoSQL database to achieve it.
 
 I am not saying anything new here. This debate has been going on for decades 
 already, and much more clever people than me have made good points for both 
 sides over the years now. 

Sure. But from time to time it is good to refresh the memory. And for me you 
are clever enough ;)
 
 You also asked for examples for problems you get from using Glorp. 
 
 One of my biggest concerns is that it can be hard to model an m:n 
 relationship where one or both sides of the relationship are abstract 
 superclasses (or even concrete ones with multiple subclasses). It gets even 
 harder when you want to be able to associate an object (like a Category or 
 Tag) to anything. This really is hard or involves some additional coding on 
 top of the persistence framework.
 
 Glorp does miss one feature painfully: The ability to map classes with 
 subclasses that spread over three or more subtables for the subclasses. 
 This one is hard to explain: if you have a superclass Vehicle with two 
 subclasses FlyingVehicle and DrivingVehicle, both of which have 
 subclasses, there is no support for a model which has tables on the 
 FlyingVehicle or DrivingVehicle level. You must model your DB in a way 
 

Re: [Pharo-users] glorp

2014-04-25 Thread jtuc...@objektfabrik.de

Hi Norbert,

I am way too old for holy wars ;-)

So in essence, we are both saying that hammering objects into either an 
SQL or NoSQL database can be hard and both approaches have negative 
drawbacks as well as plusses.
I didn't come up with Transactions because they also can make things 
hard. See the atomic counter question from a few days ago.IN ORMs you 
usually end up with both image-side and database-side implementations of 
Transactions, and this can be helpful and complicated at the same time. 
Sometimes you'd just like to save one object without saving lots of 
associated ones from the same unit of work.


Does this all lead us to the object database grounds? Or is it all just 
a debate of taste and faith? I am still wondering if my life would be 
easier if I used an object database (Gemstone comes to mind, but also 
Magma). And still I cannot find the final answer.


Maybe that is because I have some knowledge with ORM, but very little 
with OODBMS.


No matter what, my initial point should have been that I think it is 
naive to think that NoSQL DBs solve a lot of the problems you have with 
RDBMS. They just don't address them, and if you don't see som eof these 
problems in your domain, I guess you're best off using NoSQL.


ObjectID and stuff in mongo still means you have to make design 
decisions and implement something to assign/retrieve those ids and store 
them in places where you want to reference your objects. So you do a 
subset of the bookkeeping that an RDBMS can do for you by hand. Is that 
a fair way to put it?


You made a good point and I tend to agree to most of what you say.

Joachim




Am 25.04.14 10:35, schrieb Norbert Hartl:

Joachim,

thanks for your explanation. I appreciate that. I was thinking if it 
is a good idea to write my mail. Usually this ends in a holy war which 
I don’t want. Comments inline.


Am 25.04.2014 um 09:02 schrieb jtuc...@objektfabrik.de 
mailto:jtuc...@objektfabrik.de:



Norbert,

you are right, I should have given an example of what I mean.

So here is one:

If you serialize an object graph to, say, json and store it in a 
NoSQL DB, you need to decide how deep you serialize your graph into 
one djson document and how to build up segments of your graph that 
need to be serialized separately, like for an equivalent of an 1:n 
relationship. Exanple: an Order contains OrderItems, each of which 
reference a Product. But the Product can be referenced from many 
OrderItems. So you need to cut off parts of your model to serialize 
them separately. And you need a way to save the reference“.


You can do that in e.g. mongo as well. You just use on ObjectId as a 
field value or you use a DBRef. Btw. what you describe is not 1:n but 
m:n. An OrderItems can have n products and a Product can be in m 
OrderItems.


One of the next questions then is what if I delete a Product?. What 
happens to the OrderItems or InvoiceItems and so on?


If you just delete it the collections will have a stale reference. I 
think there is no universal answer to that even if it seems the 
removal in the collection is that universal answer. If it is about 
integrity you need one way to make it happen. Reestablishing of 
integrity can happen on write time or on read time.
What will happen in a SQL context? You can’t delete an object that is 
pointed to by a foreign key. What does it help then? Not taking your 
business model into account you couldn’t do anything more to find out 
where that reference is. That is probably the only point I wanted to 
make questioning your last mail. If we take that scenario you can only 
solve it if you take the problem one level higher (well, if you have 
cascading deletes you may ignore it). So these problems tend to end in 
the application logic. And that is what my experience tells me. 
Database ensured integrity isn’t much of a help in many cases. So you 
solve the problems in the application logic (knowing which things 
reference what). Being there I see no big differences to using a NoSQL 
database. In NoSQL those features are just not there per se. You have 
to model it regarding your use case.


None of these problems are unsolvable, but these problems need to be 
addressed either in your persistence framework on top of a NoSQl DB 
or in your application code. In Relational DBs, they've built 
solutions for these problems before you and I were born ;-) I am 
talking of foreign keys, referential integrities and normalization. 
To my knowledge, these have not yet found their standardized 
counterparts in NoSQL DBs. So NoSQL can be a good solution for many 
problems, but they can also be bad for many others.


I’m questioning the use of each of those. As I said above I doubt 
there are many use cases where foreign keys are the best way to go. 
Btw. if you ever administrate a database and you have to recover after 
a crash then you might have a different view on foreign keys because 
they are able to make it close to impossible to load the data 

Re: [Pharo-users] glorp

2014-04-25 Thread Esteban Lorenzano

On 25 Apr 2014, at 10:58, jtuc...@objektfabrik.de wrote:

 Hi Norbert,
 
 I am way too old for holy wars ;-)
 
 So in essence, we are both saying that hammering objects into either an SQL 
 or NoSQL database can be hard and both approaches have negative drawbacks as 
 well as plusses. 
 I didn't come up with Transactions because they also can make things hard. 
 See the atomic counter question from a few days ago.IN ORMs you usually end 
 up with both image-side and database-side implementations of Transactions, 
 and this can be helpful and complicated at the same time. Sometimes you'd 
 just like to save one object without saving lots of associated ones from the 
 same unit of work. 
 
 Does this all lead us to the object database grounds? Or is it all just a 
 debate of taste and faith? I am still wondering if my life would be easier if 
 I used an object database (Gemstone comes to mind, but also Magma). And still 
 I cannot find the final answer.
 
 Maybe that is because I have some knowledge with ORM, but very little with 
 OODBMS. 
 
 No matter what, my initial point should have been that I think it is naive to 
 think that NoSQL DBs solve a lot of the problems you have with RDBMS. They 
 just don't address them, and if you don't see som eof these problems in your 
 domain, I guess you're best off using NoSQL.
 
 ObjectID and stuff in mongo still means you have to make design decisions and 
 implement something to assign/retrieve those ids and store them in places 
 where you want to reference your objects. So you do a subset of the 
 bookkeeping that an RDBMS can do for you by hand. Is that a fair way to put 
 it?

it is called Voyage and it does all the painful referencing for you. You just 
need to declare a class as root and voyage takes care of all the work (not for 
deleting objects)

in general (not saying that you do it, but since you call it a “holy war”…), I 
think (and I’m also old enough to have battle *a lot* in all areas), I think 
most people uses relational databases for a lot of wrong reasons… then they use 
wrong tool for their problem and in consequence they end taking wrong design 
decisions just to make their model fit into a wrong solution pattern. 
Then, they repeat same problem once and again until what become hammered is 
their own head: they end thinking that the only possible solution is what they 
decided a priori, without any thinking on the real problem to solve. 
As a conclusion… how many people do you know that believes that relational is 
the “de facto” way to go instead actually think in their problem? 
In my case, while I admit there are contexts that are better for a relational 
database, I think that in object oriented programming  it should be the last 
resource: in general, the amount of concessions you have to do in your model to 
properly fit in a tabular design is just too much. So the gain should be too 
much also to make it valuable (and that of course talking in general: concrete 
problems can have other concrete solutions) :)

Esteban

 
 You made a good point and I tend to agree to most of what you say.
 
 Joachim
 
 
 
 
 Am 25.04.14 10:35, schrieb Norbert Hartl:
 Joachim,
 
 thanks for your explanation. I appreciate that. I was thinking if it is a 
 good idea to write my mail. Usually this ends in a holy war which I don’t 
 want. Comments inline.
 
 Am 25.04.2014 um 09:02 schrieb jtuc...@objektfabrik.de:
 
 Norbert,
 
 you are right, I should have given an example of what I mean. 
 
 So here is one:
 
 If you serialize an object graph to, say, json and store it in a NoSQL DB, 
 you need to decide how deep you serialize your graph into one djson 
 document and how to build up segments of your graph that need to be 
 serialized separately, like for an equivalent of an 1:n relationship. 
 Exanple: an Order contains OrderItems, each of which reference a Product. 
 But the Product can be referenced from many OrderItems. So you need to cut 
 off parts of your model to serialize them separately. And you need a way 
 to save the reference“.
 
 You can do that in e.g. mongo as well. You just use on ObjectId as a field 
 value or you use a DBRef. Btw. what you describe is not 1:n but m:n. An 
 OrderItems can have n products and a Product can be in m OrderItems. 
 
 One of the next questions then is what if I delete a Product?. What 
 happens to the OrderItems or InvoiceItems and so on?
 
 If you just delete it the collections will have a stale reference. I think 
 there is no universal answer to that even if it seems the removal in the 
 collection is that universal answer. If it is about integrity you need one 
 way to make it happen. Reestablishing of integrity can happen on write time 
 or on read time. 
 What will happen in a SQL context? You can’t delete an object that is 
 pointed to by a foreign key. What does it help then? Not taking your 
 business model into account you couldn’t do anything more to find out where 
 that reference is. That is 

Re: [Pharo-users] glorp

2014-04-25 Thread Norbert Hartl
Joachim,

Am 25.04.2014 um 10:58 schrieb jtuc...@objektfabrik.de:

 Hi Norbert,
 
 I am way too old for holy wars ;-)
 
 So in essence, we are both saying that hammering objects into either an SQL 
 or NoSQL database can be hard and both approaches have negative drawbacks as 
 well as plusses. 

Yes.

 I didn't come up with Transactions because they also can make things hard. 
 See the atomic counter question from a few days ago.IN ORMs you usually end 
 up with both image-side and database-side implementations of Transactions, 
 and this can be helpful and complicated at the same time. Sometimes you'd 
 just like to save one object without saving lots of associated ones from the 
 same unit of work. 
 
 Does this all lead us to the object database grounds? Or is it all just a 
 debate of taste and faith? I am still wondering if my life would be easier if 
 I used an object database (Gemstone comes to mind, but also Magma). And still 
 I cannot find the final answer.

The choice for a technology is not a choice about having more or less problems 
but about which problems you like to have and which ones to avoid. 

The problem we have is that main memory is persistent. The separation between 
to the kinds of memories is pain. OODBMs are the closest to mitigate the gap. 
Theoretical it is hard to decide that. It depends one what you do. I don’t use 
SQL databases because I like to work with objects. I use GemStone for quite 
some years now which is fantastic in certain cases. But I have projects where I 
need geo spatial and fulltext indexes (and fast hierarchical queries). As 
GemStone does not provide them (the hierarchical fast query you get by using 
gemstone specific stuff) and I don’t want to implement them I need something 
else. MongoDB is good at indexing geo spatial stuff. So mongo + voyage is a 
good fit for this. I need to do explicit commits and have to do additional 
house keeping both of them you don’t need to do in GemStone. But I get the 
indexing capability I need. We also do statistical aggregation of data. I used 
to do it with mongo and map-reduce jobs at night but it is cumbersome. Now I 
use elasticsearch for that because I can put in JSON and I get rich and fast 
query cababilities.
So my choices of persistence are always driven by the use case (any my laziness 
of course)
 
 Maybe that is because I have some knowledge with ORM, but very little with 
 OODBMS. 
 
 No matter what, my initial point should have been that I think it is naive to 
 think that NoSQL DBs solve a lot of the problems you have with RDBMS. They 
 just don't address them, and if you don't see som eof these problems in your 
 domain, I guess you're best off using NoSQL.
 
Agreed.

 ObjectID and stuff in mongo still means you have to make design decisions and 
 implement something to assign/retrieve those ids and store them in places 
 where you want to reference your objects. So you do a subset of the 
 bookkeeping that an RDBMS can do for you by hand. Is that a fair way to put 
 it?
 
You use Glorp and I use Voyage. It is basically the same in this regard.

 You made a good point and I tend to agree to most of what you say.
 
Thanks!

Norbert

 Joachim
 
 
 
 
 Am 25.04.14 10:35, schrieb Norbert Hartl:
 Joachim,
 
 thanks for your explanation. I appreciate that. I was thinking if it is a 
 good idea to write my mail. Usually this ends in a holy war which I don’t 
 want. Comments inline.
 
 Am 25.04.2014 um 09:02 schrieb jtuc...@objektfabrik.de:
 
 Norbert,
 
 you are right, I should have given an example of what I mean. 
 
 So here is one:
 
 If you serialize an object graph to, say, json and store it in a NoSQL DB, 
 you need to decide how deep you serialize your graph into one djson 
 document and how to build up segments of your graph that need to be 
 serialized separately, like for an equivalent of an 1:n relationship. 
 Exanple: an Order contains OrderItems, each of which reference a Product. 
 But the Product can be referenced from many OrderItems. So you need to cut 
 off parts of your model to serialize them separately. And you need a way 
 to save the reference“.
 
 You can do that in e.g. mongo as well. You just use on ObjectId as a field 
 value or you use a DBRef. Btw. what you describe is not 1:n but m:n. An 
 OrderItems can have n products and a Product can be in m OrderItems. 
 
 One of the next questions then is what if I delete a Product?. What 
 happens to the OrderItems or InvoiceItems and so on?
 
 If you just delete it the collections will have a stale reference. I think 
 there is no universal answer to that even if it seems the removal in the 
 collection is that universal answer. If it is about integrity you need one 
 way to make it happen. Reestablishing of integrity can happen on write time 
 or on read time. 
 What will happen in a SQL context? You can’t delete an object that is 
 pointed to by a foreign key. What does it help then? Not taking your 
 business model into account you 

Re: [Pharo-users] glorp

2014-04-25 Thread Franz Josef Konrad
Slightly off topic but on the other hand it fits perfectly into the 
discussion: IMHO a very enlightening podcast about RDBMS, NoSQL, NewSQL 
databases from one of the old database gurus Michael Stonebraker 
(http://www.se-radio.net/2013/12/episode-199-michael-stonebraker/).


Franz Josef



Am 25.04.2014 10:58, schrieb jtuc...@objektfabrik.de:

Hi Norbert,

I am way too old for holy wars ;-)




Re: [Pharo-users] glorp

2014-04-25 Thread Esteban A. Maringolo
Interesting discussion.

I'm on the verge of NoSQL databases, I prototyped a system with Voyage
but didn't feel confident enough as to continue with it to a
production system.

One of the things that held me back was the lack of tooling[*] and how
hard would it be to change something from outside of Voyage.
I used ORM in several fashions for over a decade, and wrote one in my
last job, so I rely more on SQL than anything else.

[*] Have tried running a complex query using MongoDB? It's JSON
syntax is awful. Fortunately MongoTalk does most of the heavylifting,
but as said before, if for any reason I need to run a query from
outside (using any other mongo client) it is not going to be easy. To
me SQL is concise.

I know need a mindset change, which I look forward to get. But today I
still have to deal with the utter-verbose definition of GLORP's
DescriptionSystem


Regards,

Esteban A. Maringolo


2014-04-25 6:30 GMT-03:00 Norbert Hartl norb...@hartl.name:
 Joachim,

 Am 25.04.2014 um 10:58 schrieb jtuc...@objektfabrik.de:

 Hi Norbert,

 I am way too old for holy wars ;-)

 So in essence, we are both saying that hammering objects into either an SQL
 or NoSQL database can be hard and both approaches have negative drawbacks as
 well as plusses.


 Yes.

 I didn't come up with Transactions because they also can make things hard.
 See the atomic counter question from a few days ago.IN ORMs you usually end
 up with both image-side and database-side implementations of Transactions,
 and this can be helpful and complicated at the same time. Sometimes you'd
 just like to save one object without saving lots of associated ones from the
 same unit of work.

 Does this all lead us to the object database grounds? Or is it all just a
 debate of taste and faith? I am still wondering if my life would be easier
 if I used an object database (Gemstone comes to mind, but also Magma). And
 still I cannot find the final answer.


 The choice for a technology is not a choice about having more or less
 problems but about which problems you like to have and which ones to avoid.

 The problem we have is that main memory is persistent. The separation
 between to the kinds of memories is pain. OODBMs are the closest to mitigate
 the gap. Theoretical it is hard to decide that. It depends one what you do.
 I don’t use SQL databases because I like to work with objects. I use
 GemStone for quite some years now which is fantastic in certain cases. But I
 have projects where I need geo spatial and fulltext indexes (and fast
 hierarchical queries). As GemStone does not provide them (the hierarchical
 fast query you get by using gemstone specific stuff) and I don’t want to
 implement them I need something else. MongoDB is good at indexing geo
 spatial stuff. So mongo + voyage is a good fit for this. I need to do
 explicit commits and have to do additional house keeping both of them you
 don’t need to do in GemStone. But I get the indexing capability I need. We
 also do statistical aggregation of data. I used to do it with mongo and
 map-reduce jobs at night but it is cumbersome. Now I use elasticsearch for
 that because I can put in JSON and I get rich and fast query cababilities.
 So my choices of persistence are always driven by the use case (any my
 laziness of course)


 Maybe that is because I have some knowledge with ORM, but very little with
 OODBMS.

 No matter what, my initial point should have been that I think it is naive
 to think that NoSQL DBs solve a lot of the problems you have with RDBMS.
 They just don't address them, and if you don't see som eof these problems in
 your domain, I guess you're best off using NoSQL.

 Agreed.

 ObjectID and stuff in mongo still means you have to make design decisions
 and implement something to assign/retrieve those ids and store them in
 places where you want to reference your objects. So you do a subset of the
 bookkeeping that an RDBMS can do for you by hand. Is that a fair way to put
 it?

 You use Glorp and I use Voyage. It is basically the same in this regard.

 You made a good point and I tend to agree to most of what you say.

 Thanks!

 Norbert

 Joachim




 Am 25.04.14 10:35, schrieb Norbert Hartl:

 Joachim,

 thanks for your explanation. I appreciate that. I was thinking if it is a
 good idea to write my mail. Usually this ends in a holy war which I don’t
 want. Comments inline.

 Am 25.04.2014 um 09:02 schrieb jtuc...@objektfabrik.de:

 Norbert,

 you are right, I should have given an example of what I mean.

 So here is one:

 If you serialize an object graph to, say, json and store it in a NoSQL DB,
 you need to decide how deep you serialize your graph into one djson
 document and how to build up segments of your graph that need to be
 serialized separately, like for an equivalent of an 1:n relationship.
 Exanple: an Order contains OrderItems, each of which reference a Product.
 But the Product can be referenced from many OrderItems. So you need to cut
 off parts of your 

Re: [Pharo-users] glorp

2014-04-25 Thread Esteban A. Maringolo
2014-04-25 6:30 GMT-03:00 Norbert Hartl norb...@hartl.name:

 MongoDB is good at indexing geo
 spatial stuff. So mongo + voyage is a good fit for this. I need to do
 explicit commits and have to do additional house keeping both of them you
 don’t need to do in GemStone. But I get the indexing capability I need. We
 also do statistical aggregation of data. I used to do it with mongo and
 map-reduce jobs at night but it is cumbersome. Now I use elasticsearch for
 that because I can put in JSON and I get rich and fast query cababilities.
 So my choices of persistence are always driven by the use case (any my
 laziness of course)

JSON is the new lingua franca of databases (and almost everything
else), as SQL was before.

Aside from pros/cons of ORM and NoSQL, there is a real explosion of
NoSQL ecosystem things like ElasticSearch, Lucene, etc, and everybody
speaks JSON.

At the infrastructure level most of the benefits of NoSQL come from
solving the Availability and Partitioning from the CAP Theorem. Truth
is... most of us don't have issues dealing with partitioning. I ran a
system with millions of rows which were perfectly handled by a single
database server, and even using replicas for off-site quering or
backup.

Making silly analogies, NoSQL is to RDBMS what JSON is to XML. Both
have their place, but most of the times the latter is
overkill/convoluted.

Regards,



Re: [Pharo-users] glorp

2014-04-25 Thread Esteban A. Maringolo
Seems like Couchbase got SQL for its documents, with joins and many
other nice features:

http://blog.couchbase.com/n1ql-it-makes-cents

I followed the online tutorial and it is pretty impressive.
Esteban A. Maringolo


2014-04-25 10:39 GMT-03:00 Esteban A. Maringolo emaring...@gmail.com:
 2014-04-25 6:30 GMT-03:00 Norbert Hartl norb...@hartl.name:

 MongoDB is good at indexing geo
 spatial stuff. So mongo + voyage is a good fit for this. I need to do
 explicit commits and have to do additional house keeping both of them you
 don’t need to do in GemStone. But I get the indexing capability I need. We
 also do statistical aggregation of data. I used to do it with mongo and
 map-reduce jobs at night but it is cumbersome. Now I use elasticsearch for
 that because I can put in JSON and I get rich and fast query cababilities.
 So my choices of persistence are always driven by the use case (any my
 laziness of course)

 JSON is the new lingua franca of databases (and almost everything
 else), as SQL was before.

 Aside from pros/cons of ORM and NoSQL, there is a real explosion of
 NoSQL ecosystem things like ElasticSearch, Lucene, etc, and everybody
 speaks JSON.

 At the infrastructure level most of the benefits of NoSQL come from
 solving the Availability and Partitioning from the CAP Theorem. Truth
 is... most of us don't have issues dealing with partitioning. I ran a
 system with millions of rows which were perfectly handled by a single
 database server, and even using replicas for off-site quering or
 backup.

 Making silly analogies, NoSQL is to RDBMS what JSON is to XML. Both
 have their place, but most of the times the latter is
 overkill/convoluted.

 Regards,



Re: [Pharo-users] glorp

2014-04-25 Thread Sven Van Caekenberghe
Here is another nice opinion:

  http://use-the-index-luke.com/blog/2013-04/whats-left-of-nosql

On 25 Apr 2014, at 11:52, Franz Josef Konrad fra...@fjkonrad.de wrote:

 Slightly off topic but on the other hand it fits perfectly into the 
 discussion: IMHO a very enlightening podcast about RDBMS, NoSQL, NewSQL 
 databases from one of the old database gurus Michael Stonebraker 
 (http://www.se-radio.net/2013/12/episode-199-michael-stonebraker/).




Re: [Pharo-users] glorp

2014-04-25 Thread Esteban A. Maringolo
2014-04-25 17:00 GMT-03:00 Sven Van Caekenberghe s...@stfx.eu:
 Here is another nice opinion:

   http://use-the-index-luke.com/blog/2013-04/whats-left-of-nosql

Very interesting article Sven.

How many companies really need to cope with data at the scale of
Google, Facebook or Twitter? Incidentally three companies that grew up
on the open source database MySQL.

And related with that quote, one of things that puzzled me a few weeks
ago was WebScaleSQL  (http://webscalesql.org/)
And if you look at its FAQs (http://webscalesql.org/faq.html), Google,
Facebook and Twitter are supporters of this project.

Also, Google provides SQL (MySQL) in its Google Cloud services, so
there is certainly a big demand for this.

So coming back to Pharo realm, this is why I think ORM is really
important for us, and I'm really happy this discussion finally took
place.

Best regards!

Esteban A. Maringolo



Re: [Pharo-users] glorp

2014-04-25 Thread Sven Van Caekenberghe

On 25 Apr 2014, at 22:20, Esteban A. Maringolo emaring...@gmail.com wrote:

 So coming back to Pharo realm, this is why I think ORM is really
 important for us, and I'm really happy this discussion finally took
 place.

But one of his points was that ORM layers made SQL obsolete by hiding much of 
its power, the ability to do (query and other) processing on the DB.

BTW, I don't think there is such a thing as transparent persistency.
 


Re: [Pharo-users] glorp

2014-04-25 Thread Esteban A. Maringolo
2014-04-25 17:44 GMT-03:00 Sven Van Caekenberghe s...@stfx.eu:

 On 25 Apr 2014, at 22:20, Esteban A. Maringolo emaring...@gmail.com wrote:

 So coming back to Pharo realm, this is why I think ORM is really
 important for us, and I'm really happy this discussion finally took
 place.

 But one of his points was that ORM layers made SQL obsolete by hiding much of 
 its power, the ability to do (query and other) processing on the DB.

You're right. But once stored in a RDBMS you can do a lot of things
with the data, using all its power.
I certainly don't expect to do OLAP with millions of rows converted to
objects in the client (Pharo) side.

As a disclaimer I have to admit I'm completely ignorant of BigData
things such as Hadoop and similar, I barely grasp their main purpose.

 BTW, I don't think there is such a thing as transparent persistency.

Certainly there isn't. Particularly for Objects.

Regards!

Esteban A. Maringolo



Re: [Pharo-users] glorp

2014-04-24 Thread Esteban Lorenzano
Hi, 

AFAIK, dbxtalk glorp is loading (and working) correctly in pharo3, at least for 
postgresql (I didn’t try the rest of the drivers)

Esteban

On 24 Apr 2014, at 06:02, Clément Bera bera.clem...@gmail.com wrote:

 Hello,
 
 I think Glorp is used with DBXTalk for relational databases by multiple 
 people.
 
 Usually, with Pharo, people use as a persistance layer either MongoDB with 
 the frameworks MongoTalk/Voyage.
 
 Gemstone is also used quite often for large scale application but Gemstone is 
 not free.
 
 Regards.
 
 
 2014-04-23 20:34 GMT-07:00 Pablo R. Digonzelli pdigonze...@gmail.com:
 Hi all, can someone tell me if glorp is active there ar is using glorp or 
 other persistence framework in production projects?
 
 Tia
 
 Ing. Pablo Digonzelli
 Software Solutions
 IP-Solutiones SRL
 Metrotec SRL
 25 de Mayo 521
 Email: pdigonze...@softsargentina.com
 pdigonze...@gmail.com
 Cel: 5493815982714
 
 



  1   2   >