Updated Dr. Geo
Torsten Bergmann notes that Dr. Geo is getting a facelift in Pharo - I did a short video on DR. Geo back at ESUG 2008. Looks cool!
. .
The author of this blog, James Robertson, passed away in April 2014. This blog is being maintained by David Buck (david@simberon.com).
Torsten Bergmann notes that Dr. Geo is getting a facelift in Pharo - I did a short video on DR. Geo back at ESUG 2008. Looks cool!
Today's Smalltalk Daily looks at using LOB data in Oracle with ObjectStudio. If you're looking for a particular topic, you can find it with the Media Search application on our site.
Here's the script used in the screencast - or just skip to the video:
"LOB buffer size example."
"When dealing with LOBs, setting the right size of buffers used to transfer
data between the server and client is important. For example, if
the LOBs are large, allocating a big buffer will reduce the network
round trips when inserting or fetching LOB values."
"The following are examples to demonstrate performance improvement when setting
the right size of LOB buffers."
"Logon to the Oracle Server."
ret := ObjectStudio.OracleDatabase
logOnServer: #OracleDB
user: #useid
password: #pwd
alias: #OracleDB.
"Get the Oracle database instance."
db := ObjectStudio.Database accessName: #OracleDB.
"Drop the test table if existed."
db execSql: 'DROP TABLE TestLob'.
"Create the test table."
res := db execSql: 'CREATE TABLE TestLob (a CLOB, b BLOB, c INT)'.
"Input 2MB CLOB and BLOB."
ClobLength := 2097152.
BlobLength := 2097152.
ClobInput := String new: ClobLength withAll: $a.
BlobInput := ByteArray new: ClobLength withAll: 1.
db beginTran.
"Insert the test data."
insertSQL := 'INSERT INTO TestLob (a, b, c) VALUES ( ?, ?, ?)'.
db lobBufferSize: 32768. "32KB is the default buffer size for read/write Large Objects."
insertTime1 := [
res := db execSql: insertSQL vars: (Array with: ClobInput with: BlobInput with: 1).
] millisecondsToRun.
"Print out the miliseconds spent."
('Insert time when lobBufferSize is 32768: ' + insertTime1) out.
"Set lobBufferSize to 1MB"
db lobBufferSize: 1048576.
insertTime2 := [
res := db execSql: insertSQL vars: (Array with: ClobInput with: BlobInput with: 2).
] millisecondsToRun.
"Print out the miliseconds spent."
('Insert time when lobBufferSize is 1048576: ' + insertTime2) out.
db commit.
db beginTran.
selectSQL := 'select * from TestLob'.
db lobBufferSize: 32768. "32KB is the default buffer size for read/write Large Objects."
selectTime1 := [
db execSql: selectSQL answerLobAsProxy: false.
] millisecondsToRun.
"Print out the miliseconds spent."
('Select time when lobBufferSizeis 32768: ' + selectTime1) out.
"Set lobBufferSize to 1MB"
db lobBufferSize: 1048576.
selectTime2 := [
db execSql: selectSQL answerLobAsProxy: false.
] millisecondsToRun.
"Print out the miliseconds spent."
('Select time when lobBufferSizeis 1048576: ' + selectTime2) out.
db rollback.
You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?
Technorati Tags: video, objectstudio, oracle, lob, database
The Cologne (Germany) Smalltalkers have a meetup scheduled for June 10th at 7pm - follow the link for the address.
Today's screencast looks at using Array binding with Oracle and ObjectStudio 8. If you're looking for a particular topic, you can find it with the Media Search application on our site. Here's the script used in the screencast:
"Array binding and Array fetching example."
"Some databases allow client control over the number of rows that will be physically transferred between the server and the client
in one logical bind or fetch. Using array binding and array fetching can greatly improve the performance of many applications by
trading buffer space for time (network traffic)."
"The following Workspace examples will show the performance improvements
when using array binding and array fetching in OS8."
"Logon to the Oracle Server."
ObjectStudio.OracleDatabase logOnServer: #'OracleDB' user: #'username' password: #'pwd' alias: #'OracleDB'.
"Get the Oracle database instance."
db := ObjectStudio.Database accessName: #'OracleDB'.
"Drop the test table if existed."
db execSql: 'DROP TABLE TESTTABLE'.
"Create a test table."
db execSql: 'CREATE TABLE TESTTABLE(
NUMMER int ,
BEMERKUNG varchar2 (30)
)'.
"Set the number of recrods being inserted."
loopCount := 1000.
"The SQL used to do inerst."
sql := 'INSERT INTO TESTTABLE VALUES (?, ?)'.
"Insert: not using array binding."
insertTime1 := [
1 to: loopCount do: [ :i|
db execSql: sql vars: (Array with: i with: 'test').
].
] millisecondsToRun.
"Print out the miliseconds spent."
('Insert without using array binding: ' + insertTime1) out.
"Insert: Using array binding."
insertTime2 := [
|bindArray numArray stringArray |
numArray := OrderedCollection new.
stringArray := OrderedCollection new.
1 to: loopCount do: [ :i|
numArray add: i.
stringArray add: 'bla'.
].
bindArray := OrderedCollection with: numArray with: stringArray.
sql := 'INSERT INTO TESTTABLE VALUES (?, ?)'.
db execSql: sql vars: bindArray.
] millisecondsToRun.
"Print out the miliseconds spent."
('Insert using array binding: ' + insertTime2) out.
"Set times to repeat."
loopCount := 1.
"Set the SQL to do the fetch."
sql := 'SELECT * from TESTTABLE'.
"Default value of arrayFetchSize is 1."
db setArrayFetchSizeTo: 1.
selectTime1 := [
1 to: loopCount do: [ :i|
db execSql: sql.
].
] millisecondsToRun.
"Print out the miliseconds spent."
('Select with arrayFetchSize= 1: ' + selectTime1) out.
"Set arrayFetchSize to be 100."
db setArrayFetchSizeTo: 100.
selectTime2 := [
1 to: loopCount do: [ :i|
db execSql: sql.
]
] millisecondsToRun.
"Print out the miliseconds spent."
('Select with arrayFetchSize=100: ' + selectTime2) out.
"Set arrayFetchSize to be 500."
db setArrayFetchSizeTo: 500.
selectTime3 := [
1 to: loopCount do: [ :i|
db execSql: sql.
]
] millisecondsToRun.
"Print out the miliseconds spent."
('Select with and arrayFetchSize=500: ' + selectTime3) out.
You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?
Technorati Tags: video, objectstudio, oracle, database, array binding
Today's screencast looks at attaching files to a store bundle. If you're looking for a particular topic, you can find it with the Media Search application on our site.
You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?
Technorati Tags: video, scm, version control, file attachment
This week we spoke to Julian Fitzell about cross dialect Smalltalk work - focusing largely on Grease and Slime, but wandering afield from there as well. It's another two part podcast - come back next week for the conclusion.
To listen now, you can either download the mp3 edition, or the AAC edition. The AAC edition comes with chapter markers. You can subscribe to either edition of the podcast directly in iTunes; just search for Smalltalk and look in the Podcast results. You can subscribe to the mp3 edition directly using this feed, or the AAC edition using this feed using any podcatching software.
To listen immediately, use the player below:
If you like the music we use, please visit Josh Woodward's site. We use the song Effortless for our intro/outro music. I'm sure he'd appreciate your support!
If you have feedback, send it to smalltalkpodcasts@cincom.com - or visit us on Facebook or Ning - you can vote for the Podcast Alley, and subscribe on iTunes. If you enjoy the podcast, pass the word - we would love to have more people hear about Smalltalk!
Technorati Tags: podcast, audio, portability
Squeak 4.1 combines the license change occurring in the 4.0 release with the development work that has been going on while the relicensing process took place. Much of the work in this release has been focused on fundamental improvements. Major achievements are the integration of Cog's closure implementation, the improved UI look and feel, the new anti-aliased fonts, the core library improvements, and the modularity advances.
Technorati Tags: squeak
Michael Lucas-Smith has an update on what's going on with the Xtreams code.
I had a question come in this afternoon, about how to get going with Store>. Originally, it required you to use a fairly "heavy" rdbms, like Oracle or SQLServer. later, Bruce Badger provided support for using PostgreSQL, which eliminated the need for client libraries. However, that still required a relatively difficult setup. There are easier options:
Mind you, those solutions are only suitable for personal use; for team use, you still want one of the bigger databases. However, this should get you started :)
Technorati Tags: scm, source code control, store
Today's Smalltalk Daily looks at a simple Time Tracker application in WebVelocity - 4 methods, with 2 additional "prettifying" ones. This was inspired after I watched the video here, comparing various web app development frameworks. No Smalltalk comparison, so I thought I'd add one. You can see the simpler "Hello World" example as well. If you're looking for a particular topic, you can find it with the Media Search application on our site.
You can download the video directly here. If you like this kind of video, why not subscribe to "Smalltalk Daily"?
Technorati Tags: video, webvelocity, seaside, web development
| Previous | Next | (1107 total) |