Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Rowan Brownlee

Ranch Hand
+ Follow
since Aug 07, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rowan Brownlee

bongo, biff, herbertBadgery, illywhacker
21 years ago
Hello all,
I've begun investigating ploticus for use in a java based web application. I have a test app that executes ploticus to produce a graph based on a script called "myLines.htm". I'm having difficulty specifying an output file. I want to define a gif name, but am finding that the resulting file takes the default (ie "myLines.gif"), regardless of the specified output file.
However, if I simply execute ploticus via a batch file in a windows 98 dos session, the gif file is produced as required (ie "defName.gif");
The command line java code and script file follow. Any comments much
appreciated. - thanks - Rowan
commnd line used in a dos session on win98
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


source code for java test app
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


script file - mylines.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~
// Use proc page to set the overall text size to 6 pt
#proc page
textsize: 9

// read data file using proc getdata - params from command line
#proc getdata
file: @file
delimit: @delimit
// Define a plotting area using proc areadef
#proc areadef
title: Psychological performance
titledetails: adjust=0,0.1
//rectangle: 1 1 5 2
rectangle: 1 1 5 3.5
xrange: 0 20
yrange: 0 25
yaxis.grid: color=rgb(.6,.6,1)

// Define an X axis using proc xaxis
#proc xaxis
tics: none
label: Alternate Recording Days
// Define a Y axis using proc yaxis
#proc yaxis
stubs: incremental 5
label: Number of 'a' recordings
// Do the curve using proc lineplot
#proc lineplot
xfield: 1
yfield: 2
linedetails: color=red
pointsymbol: shape=square style=fill fillcolor=blue radius=0.02
numbers: yes
21 years ago
Hi Philip,
I found some useful connection pooling programs in Marty Hall's "Core Servlets and java server pages"
rowan
21 years ago
I think that for drama, you just can't go past Gene Pitney and "24 hours from tulsa"
~~~~~~~
Dearest darlin' I had to write to say that I won't be home anymore
'cause something happened to me while I was drivin' home
And I'm not the same anymore
Oh, I was only twenty four hours from Tulsa
Ah, only one day away from your arms
I saw a welcoming light and stopped to rest for the night
And that is when I saw her as I pulled in outside of the small motel she was there
And so I walked up to her, asked where I could get something to eat
And she showed me where.
Oh, I was only twenty four hours from Tulsa
Ah, only one day away from your arms
She took me to the caf´┐Ż, I asked her if she would stay, she said "OK"
Oh, I was only twenty four hours from Tulsa
Ah, only one day away from your arms
The jukebox started to play and night time turned into day as we were dancin'
Closely, all of a sudden I lost control as I held her charms
And I caressed her, kissed her, told her I'd die
Before I would let her out of my arms
Oh, I was only twenty four hours from Tulsa
Ah, only one day away from your arms
I hate to do this to you but I love somebody new, what can I do?
And I can never, never, never---go home again.
21 years ago
You may have some spaces at the end of "BeethAir ". Following prints out false.
Eg.
Even better, "Never been to me" - which just tries too too hard to mean something.
"Hey lady, you lady
cursing at your life
You're a discontented mother
and a regimented wife
I've no doubt you dream about
the things you'll never do
But, I wish someone had a talked to me
like I wanna talk to you..... "
21 years ago
"Seasons in the Sun"
Can't resist an extract
Goodbye Emile, it's hard to die
when all the birds are singing in the sky. Now
that the Spring is in the air
Pretty girls are ev'rywhere.
Think of me and I'll be there.
Chorus:
We had joy. We had sun.
We had seasons in the sun,
but the hills we would climb
were just seasons out of time.
21 years ago
IE - tried to find something else that works better, but no luck.
21 years ago
Hi Siddharth,
I have each client getting their own Connection, but sharing access to a single data object (on my database server). Connection passes requests to the server. My lock manager looks after synchronisation for record locks.
Connection isn't working directly on a data object, but it is providing a mechanism to uniquely identify each client. It's also tracking locks for the client, and only allowing a client to unlock records it's already locked.
cheerio
rowan
Hi Siddharth,
Yes, that's my understanding about what happens with unreferenced. When the distributed garbage collection subsystem sees that there are no more remote clients for the object, the RMI system invokes unreferenced.
You can do lots of things within your unreferenced method. For servers, Pitt and McNiff write that "This interface is typically used for two purposes: to schedule idle-time activity of the server, and to allow a remote server to exit when idle... Many remote servers have things they could usefully do while there are no clients: cleanups, reorganizations, reports, and so on. The Unreferenced interface provides an ideal means of scheduling these activities. One particularly useful thing an unreferenced method can do is to schedule the Java garbage colector by calling System.gc." (Pitt and McNiff - The remote method invocation guide - p. 75-76)
All of this RMI and unreferenced is new to me. Prior to trawling the archives, I'd not thought about using a Connection as an intermediary between the client and database - but for my setup, it's proving pretty useful.
In my setup, Connection is the thing that a client uses to get the server to directly access the database. (A client has to obtain a Connection from ConnectionFactory, in order to access the remote database. Connection is remote, and ConnectionFactory is bound to the RMIRegistry)
For this reason, this is where I implemented Unreferenced. Since it's the Connection that asks the Server to apply and release locks (via LockManager), I'd want the Connection to know if it's no longer linked to a client (so I can get the Connection's implementation of Unreferenced to release any outstanding locks).
When I was thinking of using Unreferenced, I implemented it in several places, just to get an idea of what was happening. However, it was the problem of releasing stale locks that focussed implementation within the Connection class.

cheerio
rowan
Hi Karthik,
Yes, unreferenced is an interesting feature alrighty - I heard about it while trawling the archives.
I'm still writing my project. I haven't used a forced timeout, but I suppose my use of unreferenced sort of does that anyway. I think the default time period is 15 minutes. Then unreferenced is called (and my implementation unlocks all outstanding locks applied by this Connection).
As for a rogue client trying to get around the lock/unlock sequence - that's one of the things I'm looking at by using Connections. (That's a good question about ignoring unlock - will have to have a think about that.)
In terms of identification, each client gets a unique Connection - which in itself can be used for identification. At this stage, I'm not needing to identify clients to control locks (though I'm yet to fully test this).
cheerio
rowan

Originally posted by karthik Guru:
hi Rowan,
Thanks for pointing out the usefulness of the unreferenced intereface. This one is a nice feature i was'nt aware of.
Unfortunately i did'nt use it when i did my SDCD (some 7 months back!)
anyway i have a question for you.
I remember that i had implemented forced unlocking after a timeout.
I understand that in your case if the client crashes, you can take appropriate action and release the lock.
Did u have a forced unlock by any chance?
Do you think anything can be done, if the client chose to ignore the "lock-read-modify-unlock" sequence (ie ignored the unlock ("just a wierd possibility")).
How did you do client identification?
is your identification based on the passing objects between client and server?
OR did you implement Callbacks?
thanks!

I'll join your religion, so long as I can do a Benny Hinn and cultivate a wild bouffant
cheerio
rowan
21 years ago
I was watching a terrific Space documentary series, and it argued that we're only here because of Jupiter - that Jupiter catches enormous numbers of meteors that otherwise would have long since destroyed this planet.
On another note, Australia used to host a southern hemisphere meteor/asteroid observation service. However, the Howard government (loathed by about 50% of the population) decided to save money and shut it down. Given their obsessive vilification of unauthorised arrivals (in the form of refugees and asylum seekers), it's ironic that they decided to have no 'border protection' from an actual threat. (Looks like I'll just have to add this to the hundred million billion long list of things I can't stand about Howard.)
cheerio
rowan
21 years ago
Rowbr Walak
21 years ago
When I think of Lake Tahoe, I think of the beautiful scenery, and I also can't help thinking of that scene in the Godfather where Fredo is out on the lake and gets one in the noggin for ratting out the family.
cheerio
rowan