. .

smalltalk

Adventures in Upgrading VW

December 4, 2012 20:34:08.815

I've done a fair bit of the initial changes necessary to update our code from VW 7.6 to VW 7.9, and I was at the point where I wanted to try running the application (to see what else needed fixing). That's when I ran into a curious issue with Oracle, where a stock query we run was failing, with Oracle telling us "not all variables bound".

That seemed strange; the code (which worked fine in 7.6, and did this, more or less:


conn := OracleConnection new.
conn
	username: 'someUser';
	password: 'somePassword';
	environment: 'oracleDB'.
conn connect.

session := conn getSession.
session bindInput: #(1).
session prepare: 'select * from categories where id = ?'.
session execute.
answers := session answer upToEnd.
conn disconnect.
^answers

Now, that code worked just fine in older revs of VW (and, in testing it against Postgres just now on my Mac, it still works fine in 7.9). To get it working against the Oracle, we needed to do this:


conn := OracleConnection new.
conn
	username: 'someUser';
	password: 'somePassword';
	environment: 'oracleDB'.
conn connect.

session := conn getSession.
session prepare: 'select * from categories where id = ?'.
session bindInput: #(1).
session execute.
answers := session answer upToEnd.
conn disconnect.
^answers

Can't spot the difference? The change moves #bindInput: after #prepare:. In the latest VW, the bind values are cleared in #prepare: - so if you do binding first, you end up with.... no binding. I did have a look at the release notes for 7.9.1, and the section on Oracle changes is reproduced here by Cincom - nothing on this change. It's easy enough to deal with; I just wish this had been in the release notes.

Tags: ,

posted by James Robertson

 Share Tweet This