Seaside 3.2 Session timeout & let’s start a blog parade

Seaside 3.2 is not actually new, but we just recently switched to VAST 8.6.3, which ships with Seaside 3.2. Before that we were on VAST 8.6 and Seaside 3.1.x (x=I don’t remember exactly).

Among the numerous changes in Seaside 3.2 is the new session timeout configuration. Up to Seaside 3.1 the way to configure session timeouts was this:

app :=
        (WAAdmin register: self asApplicationAt: 'Buchhaltung').
app cache expiryPolicy configuration at: #cacheTimeout put: 2400.

This has been changed in Seaside 3.2. The change is not downward compatible. If you execute the snippet above, you get a doesNotUnderstand: #expiryPolicy exception.

The new way to do it is this:

app :=
        (WAAdmin register: self asApplicationAt: 'Buchhaltung').
app configuration at: #maximumAbsoluteAge put: 14400.
app configuration at: #maximumRelativeAge put: 2400.
app cache: app createCache.

This is not a dramatic thing per se, but I’d like to draw my readers’ attention to two important things.

First: you need to send the cache: setter to the WAApplication instance, otherwise, the settings you made before won’t be effective. I’m sure there is a reason for this and it is just the way it has to be…

Then there is this little anecdote. At first we just set #maximumAbsoluteAge and left the relativeAge alone, which means the default value of 30 minutes is effective. We didn’t really pay attention, because there were so many small and big things to do during our migration, we had to fix a few things in Glorp and such, and all seemed fine.

…until more an more users complained they got kicked out of our site in the middle of working. The first few times we heard about it, we thought that maybe these people were just forgetting that there had been a coffee break or a phone call and they sure must have been idle for 40 minutes.

But the calls were coming in and also people we’ve been knowing for a while and who know the system quite well started telling us that, no, they hadn’t been idle.

We still had no clue, because things had been working well for years and a few attempts to find something obvious had failed over and over again.

One day, a team member looked through some logs and found something strange: a few users re-login after a bit more than 40 mintes, not 50, not an hour and a half, just about 40-43 minutes after their previous login.

So we had a clue. Things went fast from then on 😉

So what had happened?

By setting maximumAbsoluteAge to 40 Minutes, we had told Seaside to kill every session after a maximum of 40 seconds, no matter if people had been idle or not. So what we actually had configured that a session will be killed after 30 minutes of inactivity (default) and definitely be killed after 40 minutes, even if the user is in the middle of entering data….

To many Seaside users, this will sure be old hats. To us it wasn’t and this is just a little “lesson learned” that may or may not be helpful to other Seaside users.

Have you had similar stupid errors by misconfiguring Seaside? Share your anecdotes in the comments or – even better – let’s start a blog parade on “Stupid Things I did in Seaside” to share such dang moments and help each other sail around these….

 

 

Job offer in Hamburg, Germany (e.g. Gemstone/S)

Marten is looking for a new colleague. I highly recommend this position, they do amazing stuff, use an interesting mix of technolgies, including Gemstone/S

Schrievkrom

The company I work for “dimap, Das Institut für Markt und Politikforschung” (www.dimap.de) is looking for a developer (maybe student) here in Hamburg, Germany. We are developing software systems using various programming languages (C#, Java, Python, Javascript and Smalltalk (Gemstone)). It would be *very* nice, if the person would be interested to do development in Gemstone.

View original post

Camp Smalltalk Durham/Raleigh March 2017

Instantiations, Inc. just announced they are sponsoring a Camp Smalltalk at Durham, North Carolina March 31st – April 2nd, 2017.

You wonder what a Camp Smalltalk is? Well, that’s easy, let me explain to you:

A few hands full of Smalltalk debvelopers, enthusiasts and also interested newbees meet for a few days at a nice location with everything you need (outlets, wifi, coffee, mainly) and do some coding together, learn from each other, get in touch and chat about interesting topics and exchange ideas. Camp Smalltalk is where many of the most famous projects in the Smalltalk world were born or at least debugged and extended.

So if you happen to have time by the end of March and would like to get in touch with Smalltalk developers from all kinds of open source and commercial projects, and if Durham/Raleigh is in your reach, consider registering for a weekend full of fun and learning. Plan for an extra day to catch up on sleep afterwards 😉

You can find all the details about the when and where and who on the Camp Smalltalk RDU site.

Glorp/DB2 – Tip: Sorting case insensitive

If you are working with Glorp and DB2 and use #orderBy: you may have found out that the results of ordering by CHAR or VARCHAR columns may end up strange. DB2 assumes that a Small letter is less than a capitalized one. “Hans” is lower than “HANK”.

In my case this came obvious in a query that was issued using GLORP like this:

^self dbSession readManyOf: Person orderBy: #lastname

This may or may not be surprising to you, it is not in line with the kind of sorting you’d expect in a telephone book or Lexikon (if you’re old enough to remember, otherwise this post is probably useless for you 😉 ).

I was wondering for a moment whether this is Smalltalk’s or DB2’s fault. So I tried evaluating these two expressions:

#('Hans' 'HANK') asSortedCollection --> SortedCollection('HANK' 'Hans' )
#('Hans' 'Hank') asSortedCollection -->SortedCollection('Hank' 'Hans' )

So Smalltalk’S sorting fits with my expectations and DB2 is to blame.

It turns out this is a common problem in the SQL world, as you can readon Stack Exchange. So what is needed is a way to change the SQL statement that gets created by Glorp in order to get the “correct” results. So first we need to know what the SQL should look like. There are a few options, but these two seem to be the most commonly used ones:

ORDER BY LASTNAME COLLATE NOCASE

ORDER BY UPPER(LASTNAME)

There may be differences in execution speed, but for me the more important question was how to change my Glorp Query to produce one of these two variants.

It turns out it is easy to achieve:

^self dbSession readManyOf: Person orderBy: [:f| f lastname asUppercase]

 

Instantiations releases VA Smalltalk Version 8.6.3

vast863While it is no secret that Instantiations is working on a new 64-bits VM and Image for its VA Smalltalk system, innovation in all kinds of Software packages that can be connected to VAST doesn’t stop and wait for it to be done.

So Instantiations just announced the immediate availability of VA Smalltalk 8.6.3, a version that mainly ships upgraded class libraries for communicating with the outside world. Here’s a list of what’s new in VA Smalltalk 8.6.3:

• Communications
o IPV6 Support

  • Middleware
    o SQLite 3
  • Security

o OpenSSL 1.1 Compatibility

o Cryptographic Support

  • Native Interface Support Enhancements o Long Datatype Support
  • Installation
    o Headless Windows Installero Solaris PKG Installer

    o Headless Importer

  • Updated OS Platformso Ubuntu 16.10
    o Fedora 24
    o Red Hat Enterprise 7
  • Documentation
    o Updated Migration Guide

So you can clearly tell that Instantiations aims to make VA Smalltalk play nicely on current operating systems and to be a first-class citizen of today’s communication and security standards while we all are waiting for the “big 64 bits bang”.

The “little” enhancements in the installation process have life of users easier over the last few releases and still continue to do so.

If you want to learn more about what’s new in this release and what’s to come in the near future and what the status of the new 64 bit VM is, you should definitely take a look at these slides from John’s talk at FAST in Argentina in November 2016.

Where to download?

A free time-unlimited and fully functional evaluation copy of  VA Smalltalk can be downloaded from the company’s website. Registered users with a current support contract can get the software free of charge and also download the unlock files at this location.

If you want to buy VA Smalltalk or need assistance in your project

If you’d like to learn more about VA Smalltalk or need help im migrating from an older (maybe as old as 6.x from IBM) version of VisualAge Smalltalk, feel free to contact us at objektfabrik for the German-speaking market ot Instantiations directly from all other areas on the planet.

 

Zürich Smalltalk Meetup Nov. 8th, 2016

There are great news about the upcoming Smalltalker’s Meetup in Zürich.

We’ve found a conference room for the evening and will start off with a “show us your project” session in a room with a big screen and start the social part after your input at a nice Australian Steakhouse.

The best thing is: we already have a first session: Michal is going to show his new Gemstone-based persistence framework for Pharo. It can be used to develop in Pharo and keep your objects stored in Gemstone.

We need your input

This new setup with a meeting room adds more value to all of us: we can now not only talk about each others’ epxeriences and porjects, but see what they’re up to and what they found.

So to make this event an even better one than before, we need people who’d like to share their ideas, their latest work on some hobby or professional project. There’s no need for a full-fledged sales pitch with fog and visual effects and such, just bring your laptop and show us what you do! The room is reserved for ca. 1 hour, so we can have, say, 2-3 presentations before we leave for beer and steaks.

So if you have something interesting to show or would like to find people to join on some early project you’re starting/planning, give us a chance to learn about it. If you’ve built some interesting tool or use Smalltalk for something very special to you, let us know and share your fascination and ideas. We’ll sure appreciate that!

But if you spontaneously decide you want to show something or start some discussion, feel free to do so. You just need to be prepared that we might have to leave the room before it’s your turn. Timeslots are limited.

It would be good if you’d pre-announce your demo to me for two reasons: first, we can see if we need to rent tho room for a little longer, but even better, your topic might attract even more people so I can post your topic and make sure people get the message.

So where and when?

We’ll meet at 7pm on Nov 8th, 2016 at

Alpha Sprachwelt AG
Stadelhoferstrasse 10
– Room 23 –
8001 Zürich

See the location on a map

Around 8-8:30 pm we’ll walk over to the Outback Lodge where we’ve reserved a table. With Steaks and Drinks we can discuss ideas, talk about the good old times or do some spontaneous hacking. For directions to the Lodge visit http://www.outback-lodge.ch/index.php/stadelhofen

How to register? How much is it?

This is a meetup of friends, so it’s free to come, we look forward to meeting you and keeping in touch. You pay your meal and drinks, but the rest is free.

We ask you to register on our Doodle page at http://doodle.com/poll/c9c7tatwqppyhkhq

Please also indicate in a comment to your registration if you want to give a short presentation.

 

See you soon in Zürich!

Expressions you’d probably never type

… and yet they give the expected result. I just tried this one, assuming it’s probably worth a try, but it will most likely not work:

String with: Character cr with: Character lf.

Not that this is interesting or such. I was just surprised you can use with:with: to create Strings. Go back to work, nothing else to see here 😉

Zürich Smalltalk Meetup, Nov. 8, 2016?

It’s been almost a year since the Zürich Smalltalk users met. What a pity. So I’d like to get the ball rolling to gather interested Smalltalkers to meet on Tuesday, November 8, 2016.

If you are interested, drop me a note or mail and I’ll keep everybody updated on the exact time and place.

Where to meet? What to do? Why come? How to help?

The place we met over the last few years was a nice restaurant/bar, so having dinner together and chatting was interesting, fun and informative. But we never actually got to the point where we could exchange ideas, nobody pulled out their laptop to do some pair programming or debugging on some interesting issue. I’d love this to happen. Just imagine you have some beer (or Schorle or green tea) with a bunch of Smalltalkers and suddenly you find out somebody has the same problem in (Glorp/Seaside/you name it) and you just start tackling it together. And after a 40 minute session you just present the problem and your solution to us. Sounds like lots of fun, doesn’t it?

Last year we discussed whether we could meet at a place where people can give short demos of their current work or show some cool tool they found or whatever, rather than just sit together at a table and chat all night. Unfortunately, so far nobody came up with a suggestion. Dimitris suggested trying to find a hacker space and see if we can meet there. There are several hacker spaces in Zürich, so if you not only would like to meet other Smalltalkers, but also are in contact with somebody at a hacker space, let’s talk and see if we can arrange somtehing. If the date in November doesn’t fit, let’s talk anyways, I’d love to get the ball rolling.

A hacker space is not only a great place to meet the community, it is also a place to get in touch with people who aren’t yet part of it. Open (minded)ness is part of the concept of hacker spaces, so we might even have the chance to make new friends…

If you happen to work for a company that might host us in some meeting room or you know a nice restaurant where we can use a side-room for our meeting, sound off in the comments or drop me a mail.

Seaside: Registering a WAApplicaton too late leads to an HTTP 503 error

[Update: Thinking about this a little more, this post has a misleading title. This is very likely not to be a Seaside issue at all, but one of VA Smalltalk’s WASstServerAdaptor, which, if started/registered too late (whatever too late may be), doesn’t get realized by Apache. So the title of this post should rather be:

VA Smalltalk: registering a WASstServerAdaptor too late  leads to an HTTP 503 error

/Update]

From time to time, I learn something new. Sometimes it’s fun, sometimes it’s less pleasant. And sometimes it feels like wasting lots of time.

Yesterday, I lost a lot of time, and I ended up only understanding the problme and found a way to circomvent it. But I don’t really understand why things happen the way they do. So if a kind soul out there reads this and understands the reasons for the problem, I am grateful for helpful comments 😉

So here is the story:

During startup of our Seaside Application, we load a lot of read-only data into memory. This takes a while, almost half a minute. During that time, the server shouldn’t really accept user logins because if that data isn’t pre-loaded, the server can’t really do anything useful for users – other than write friendly walkbacks that keep our developers happy 😉

Since the main purpose of our Server Application is not being started, but to run and do useful stuff, and since under normal circumstances a restart of the application is not necessary for days, sometimes even weeks in a row, we just tried the simplest thing that could possibly work. We would just start the WAServerAdaptor after the pre-loading of data is finished. In pseudo-code the sequence looks like this:

self loadAllNecessaryStuff.
self startSeasideAdaptorOnPort: xxxx.
WAAdmin register: MyApp asApplicationAt: 'TheBestStuffYoullEverSee'.

We thought this is a clever idea. Users visiting our Application would see an HTTP 503 served by Apache during startup. This would be good enough, because we only restart the Application late at night under normal circumstances, and there would be only a small chance that anybody would be affected, although it did happen once or twice before.

So we started the Application, started Firefox and tried to see the results. All worked well: Apache answered an HTTP 503 Service not Available.

A bit surprising was the fact that Apache didn’t change its mind after a minute or so. Still a 503.

A look at the Application’s logfile said: the pre-loading is done, we’re ready to go!

Another minute later, Apache still was very confident in the fact that nobody is listening on port 8080. So we tried locally with curl, and there really was no answer. Looking a bit closer at the log output of the Application also gave us a bit of a shiver: the usual startup log output of the WASstServerAdaptor were missing from the log.

So we changed the startup sequence of our Application to look like this:

self startSeasideAdaptorOnPort: xxxx.
self loadAllNecessaryStuff.
WAAdmin register: MyApp asApplicationAt: 'TheBestStuffYoullEverSee'.

This is much better: During the pre-loading, Seaside now answers with a short message saying that /TheBestStuffYoullEverSee is not found.
And when the pre-loading is done, users are greeted with a login page.

One day we’ll probably add a nice page saying: please wait, the server is currently starting. But for now, this is enough. This whole thing is not happening often, and we just want to avoid getting walkbacks just because somebody logged in too early, because that’s a waste of time.

So here is what puzzles me:

  • What sequence of events leads to the fact that the Application is not answering request, or better: why doesnt SST register the handler?
  • Is this a Seaside bug or an SST bug in VAST?
  • How can we tell if registering a handler is too late? how late is too late?
  • How can this be too late at all? I mean, we’re starting to listen at a port, and no matter if this happens a second after an image starts up or five minutes later, this should work, right?

Even though the matter is fixed for us now, there is some bitter taste somewhere in my throat.

MOOC on Live Object Programming in Pharo

inria41010session01-730x412_q85_crop-scaleEver wondered why Smalltalk developers love their environment and what all the buzz about Live Object Programming is about?

Would you like to learn Smalltalk and understand why Smalltalkers are so passionate about it?

Maybe this Free online course is the right opportunity for you to start discovering a new level of programming and widen your horizon.

Here’s an excerpt from the course description:

[Pharo] offers a unique developing experience in constant interaction with live objects. Pharo is elegant, fun to use and very powerful. It is very easy to learn and enables to understand advanced concept in a natural way. When programming in Pharo, you are immersed in a world of live objects. You have immediate feedback at any moment of your development on objects representing web applications, code itself, graphics, network…

You can read more information about the online course (mooc) and register here:

Live Object Programming in Pharo