Larry LeFever

Greenhorn
+ Follow
since Jun 13, 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 Larry LeFever

I used the command-line debugger (jdb) to test my locking scheme.
I ran two or three instances of the client app without the GUI -- as essentially my own test-harness. I ran each in the debugger. I set a breakpoint right after the lock()-call in each one.
That showed that when a given record was locked (by whichever client I'd started first), other clients indeed had to wait until I entered "continue" in the debugger in which the other one(s) was(were) running. That allowed the one(s) with the lock to release it, thereby giving the other(s) a chance to proceed -- realizing that there is contention sometimes (when more than one is waiting for the lock on a given record).
dbping logs in with "scott/tiger". so does SQL*Plus, but WebLogic (eval. edition) cannot, in case of use of pooling and a DataSource in the configuration. Errors like "Connection Refused" and "Invalid Login" (even though using same login as with dbping and SQL*Plus, which both succeed).
Using:
- WebLogic 6.1 SP2(eval. edition)
- Oracle 8i (8.1.6)
- Windows 2000
(just for working locally, as dev-box)
Attempted config with WL OCI driver and also (later) with Oracle "thin" driver.
I got, from this site, advice about dbping. I used that to solve one license-related problem, which enabled dbping to finally succeed.
Perhaps an error in edited tsnnames.ora file? Perhaps errors in entries in the console, in the the pooling and/or DataSource config areas? In the CLASSPATH?
I've un-installed WL. Plan to re-install it tomorrow (Wed.). Might need to re-initialize (re-install) Oracle, too -- to get a fresh start (no great loss there -- just getting started).
Much on-line help seems miscellaneous and ad hoc to me -- a newbie to WebLogic.
I'm looking for a careful methodical installation and troubleshooting checklist, or the like.
Anybody got any such thing?
(I must be missing something that's obvious to many others -- especially in this discussion-group.
Any assistance would be much appreciated.
Thank you in advance.
21 years ago
I've read only a little about it, in particular in the Java Community Process section of sun's site.
I'm interested, generally, in OLAP. It seems to be a very important and valuable technology.
------------------
It seems pretty silly (and unrealistic) to have the client-app make discrete calls to "lock()" and "unlock()", especially if RMI is used (issue: granularity of remote methods).
Partly in the interest of ensuring Sun's test harness will work properly with my solution, I'm consequently planning to implement "lock()" and "unlock()" so as to effectively be no-ops unless a private flag is set indicating that the caller is one of the update-related methods (of the Database class).
That is, the implementation of, e.g., "updateRecord()" would set such a flag as "doLock"; and, in the local case, "lock()" would actually do the locking, while, in the remote case, the remote "updateRecord()" method will have been called so "lock()" will be called only on the server-side.
This way, each, e.g., server-side, thread would be responsible for calling "lock()" and then "unlock() within each update-related method, so the server-side wouldn't need to keep track of which client has the lock on which record, since each would have to "wait" and asynchronously poll for that lock, regardless of which server-side thread was last to set it.
(Incidentally, I'm also planning to implement the lock with the help of a third value for the status-byte that's at the beginning of each record: "locked" in addition to "live" and "deleted"; and, of course, I'd bitwise-OR "live" and "locked" as needed).
And I figure I'll use that idea I just saw mention of on this discussion-board, regarding running, periodically, a kind of lock-garbage-collector thread.
However, it occurs to me just now that, using my strategy as described above, records would be left improperly locked only if the server crashes, since its a server thread that would be running any given update-method, which would be handling both locking and unlocking in the context of that one method.
I'm pretty confident this strategy will work, but I'm not so confident it will be compliant with Sun's test harness.
Any thoughts?
------------------
May I use, in my exam-solution, Rickard Oeberg's enhanced version of JavaSoft's dynaserver (that's what Oeberg calls it) -- that is, to support Dynamic Classloading ? Or do I need to write my own?
------------------
I was recently laid off, and I'm preparing to develop my solution at home. I was going to use jdk1.3 (and use its rmiregistry). A former colleague of mine (not laid off) said, on my last day at work, that he'd be willing to QA my solution on a Solaris box at work (presumably also with the jdk).
So, what qualifies as a "production ... version" of the Java 2 platform, do I need to get myself one for my development at home, and, if so, then which "production ... version" should I get? Also, will I need to ensure that that colleague of mine will have access to such a "version"?
------------------
I switch off the JIT in order to see source-code line-numbers in cases of NullPointerException -- very helpful (otherwise, one sees, in the stacktrace, only "Compiled Code")
21 years ago
While using the command-line arg to switch off the JIT, I've sometimes been able to see src-code line-numbers in stacktraces, but at other times not. I'm trying to figure out how to ensure those line-numbers appear. One idea is that VAJ is using Sun's compiler, whereas WebSphere (running under AIX) is using IBM's compiler (because builds are re-compiled on the dev-box, rather than just transferring the compiled codebase to that box). Does this problem, in fact, have anything to do with the difference between Sun's compiler and IBM's? (please respond to my work email address: llefever@organic.com)
21 years ago
"Therefore, if I have a .java file that contains a base and derived class, all the methods will be in that .class file. " Really? Since when is the definition of more than one class written into any given class-file? Wouldn't that create redundancies? There's a difference, isn't there, between the derived class's method-table containing entries for the methods it inherits vs. the derived class's definition (in the class-file) containing the byte-codes of those inherited methods? Please clarify.
21 years ago
Last night, I tried unsuccessfully to create a self-signed certificate (for SSL purposes), using the keytool. Then, I sent it (as an attachment) to the virtual server hosting center where I wanted it to be installed.
I want to use a self-signed certificate, because I want to use it only for a special intranet/extranet application I'm developing as a programming exercise. Meanwhile, Verisign, if I'm not mistaken, charges some $300.00 for one of their certificates.
The hosting center just wrote back to me, saying Apache wouldn't start after having installed that certificate. (Removing the certificate enabled Apache to start again.)
So, is there a way to create a certificate file (and a "key file") for Apache, using the keytool?
22 years ago
If their IP is one of the following (or is in any of the following ranges), then, as I understand it, they're coming from an internal (i.e., intranet) address.
Subject:private routable IP addresses
Class A: 10.x.x.x
Class B: 172.16.x.x - 172.31.x.x
Class C: 192.168.x.x
22 years ago
Why read one byte at a time? Better to read some buffer-size at a time, and then write that buffer completely during each iteration -- making sure you call "flush()" during each iteration. Otherwise, you might lose data. You might be inadvertently overwriting that one byte that you've just read from the URL. "flush()"-ing your out-buffer before re-filling it might be worth a try. That's how I'd do it.
Also, I forget whether or not reading from a URL-stream includes the HTTP-headers in what you read. Of course, you don't want to store those in the binary file.
22 years ago
See "Taming Java Threads", by Holub. He demonstrates the use of the concept of a "spin lock". It's simply a matter of testing a condition-variable in a while-loop, rather than testing it only in a simple if-statement.
The need for this arises from the fact (according the book in question) that "wait()" cannot be relied upon to have been implemented "atomically". Consequently, thread A might be notified first but get the lock second (relative to some other thread B, say). This allows thread B to change the condition in question to the opposite of what thread A assumes it will be once it's notified. In such cases (without a "spin lock"), the thread (i.e., thread A), once notified, will run code that assumes a certain condition that's false is true, and that, as they used to say, is a "Bad Thing".

// Check if its empty and wait if it is
if(tray.isEmpty())
{
System.out.println(name + "Oh no, its empty. Better wait then...");

try
{
tray.wait();
System.out.println(name + "...finished waiting");
}
catch(InterruptedException e)
{
System.out.println(e);
}
}
oops.
that's only for locals and args, right?
22 years ago
doesn't "i" need to be final in order for the nested class to reference it?
22 years ago