. .

smalltalk

Updated Dr. Geo

April 21, 2010 16:18:12.116

posted by James Robertson

 Share Tweet This

smalltalk

Using LOBs with Oracle and ObjectStudio 8: Video

April 21, 2010 9:02:56.927

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: , , , ,

posted by James Robertson

 Share Tweet This

smalltalk

Smalltalk in Cologne

April 21, 2010 7:01:45.268

The Cologne (Germany) Smalltalkers have a meetup scheduled for June 10th at 7pm - follow the link for the address.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

smalltalk

Using Array Binding with Oracle and ObjectStudio 8: Video

April 20, 2010 9:55:07.782

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: , , , ,

posted by James Robertson

 Share Tweet This

smalltalk

Attaching Files to a Store Bundle: Video

April 19, 2010 8:08:29.838

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: , , ,

posted by James Robertson

 Share Tweet This

smalltalk

Across Smalltalks: Industry Misinterpretations 184

April 18, 2010 22:56:22.206

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: , ,

posted by James Robertson

 Share Tweet This

smalltalk

Squeak 4.1 is out

April 18, 2010 0:33:55.620

Spotted in Planet Squeak

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:

posted by James Robertson

 Share Tweet This

smalltalk

Progress on Xtreams

April 17, 2010 0:48:50.015

Michael Lucas-Smith has an update on what's going on with the Xtreams code.

Technorati Tags: ,

posted by James Robertson

 Share Tweet This

smalltalk

Simplest Way to Start with Store

April 16, 2010 15:48:36.188

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: , ,

posted by James Robertson

 Share Tweet This

smalltalk

A Time Tracker in WebVelocity: Video

April 16, 2010 8:54:23.191

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: , , ,

posted by James Robertson

 Share Tweet This

Previous Next (1107 total)