%%weblogic cluster iview q

[b] = [[ weblogic bible ]]
12-month iview questions

Q: give some cluster-techniques for java programmers in your real projects. P 802 [b]

Q: in a cluster, how do session attributes differ from context attributes@@ p 803 [b]

Q: how do u verify session transfer without a web app@@ No answer

Q: how do u know when session transfer fails (without running a web app) @@ No answer.
A: logs?

Q: can u get email alert if a cluster node fails@@

Q: how does the “system” know a node is dead or alive? What’s the “system”, exactly? P798 [b]

Q: replication frq@@ How do u verify@@ logs@@

Q: failover of active jdbc session@@ I doubt it


Q: how do u start the cluster and verify node1 and 2 are linked up@@ log@@

Q: when u deploy an app, u can choose which nodes, but can u choose whether to deploy to the admin server of the cluster? (Hint: the admin server is for the domain, not only for the cluster)

Q: deploying a webapp. do u have to copy to node1 then copy to node2@@ In that case how does the system ensure the 2 copies are identical@@
A: u copy to admin server?

java^dotnet — real reasons of CIO to choose java

* proven track record in “my” industry
* better integration with enterprise-grade infrastructure. Large systems usually need the power of Oracle/DB2/Sybase, Solaris/AIX, Weblogic/Websphere, perhaps beyond microsoft platform

* better support by “my” approved vendors — ibm, oracle, tibco, weblogic… Credible driving vendors for dotnet boil down to just 1 — Microsoft.

* avoid lock-in by microsoft. JVM is now offered by IBM and BEA.
* competent developers in java^.NET? I think at least 50% more, given the differing maturity
* more capabilities and products including open-source. Even if a single needed capability is available in java but not .NET, this one factor alone could be overwhelming.

java exception q&&a – nontrivial

A minimum custom exception : “class e1 extends Exception {}”
Q: Where’s the constructor? where’s is the e1(String) constructor?
a: a constructor is needed for the exception obj’s “new” operation

q3: when an exception is thrown, control passes to…?

a1: wrap the exception-prone statements in a try-catch

A: constructor is the invisible e1(){super();} There’s no e1(String)
constructor in this case, since u didn’t define it.

q: is there a constructor for each exception obj?
A: i think so, including the no-arg

a4: on the heap

q1: how do u keep your method “alive” if u know an exception can be thrown
prior to a normal return?

a2: inside the exception obj and the exception type (ie the full class
name), but often there’s nothing inside the obj

q4: is exception obj created with new()? on the heap?

A3: exception handler for this particular (type of) exception

q2: there is specific information about each exception. who needs this
info? where is this info stored?

struts^spring-mvc: 1-controller@@

Struts also has an “specialized” controller per action — the LoginAction/SignupAction/DetailsAction… classes, even though they only constitute part of the controller. The singular ActionServlet is the other part of the controller.

In summary, For Each action u need 0 or 1 form, 0 or more views, a 2-part controller, 1 mapping to tie them together

As you can see, the Model thingy is elusive.

illustrating minimal DB index

–an analogy to illustrate index concept (master copy on recoll->tref): a pile of receipts sorted by shipping date

one record number on each receipt => row-id
one non-unique customer name on each page.
one unique but unsorted order number on each page

Goal: given names or order numbers, quickly get to the relevant receipts without Scan.

To build an index on the unique order number is easy — use a spreadsheet or a stack of cards to record the order-numbers vs receipt-numbers, and sort by order-number. (B*-tree is slightly diff)

To build an index on names… After sorting, cards with same names would come together. U need to consolidate them on 1 card.

sql normenclature

Clarity and brevity are the #1 and #2 goals of technical communication.

A stored function can serve as a “select ITEM”, an “order-by-ATTRIBUTE”, a “group-by-FIELD”, or part of a “where-CRITERIA” or “having-PREDICATE” — “criteria/predicate” are more precise than “condition”.

A view and a sub-select can serve as a “from TARGET”

A forkey entry/value “references” a prikey entry/value.
3 forkeys (columns) can “refererence/point-to/refer-to” the same prikey.
A table can have 2 forkeys (columns) pointing to 2 prikeys, in 2 tables.

“20 rows, each containg 4 FIELDS” —- Avoid “column” .

A column can “hold 14 ENTRIES / values ” (Avoid “values” ) but only 9 “distinct values” including the special “null value”.

The 14 entries include 2 “null ENTRIES / values” (Avoid “values” ) , so there are only 12 KNOWN-VALUES.

“Entry” has a more specific meaning. “2 null entries” sound better than “2 null values”.

Many say “These 2 values are identical.”, but It’s clearer to say “These 2 RECORDS are identical” when you select several non-key columns.

“duplicate ENTRIES / RECORDS” —- Avoid “values”

%% iview quiz #9 — pl/sql

I wrote countless PL/SQL programs over 5 years but my limited recall of details isn’t convincing to interviewers. There are big volumes devoted to pl/sql. I think some big companies rely heavily on pl/sql and would value deep pl/sql experience, including lots of important details.

Sugg: put your findings on the internet and attract exposure
Sugg: develop simple learning aids such as binary frameworks
Sugg: self-quiz. Here’s a largely unordered list of mock iview questions.

– top 5 concepts: cursor, exception, perf/volume
– Keep for 2 years.
– answers? no need

a7: 2 extremely powerful uses of functions with views
1) use a function in a view definition, as a select field
2) instead-of triggers on a view can employ a function
A34: largest pl/sql procedure in our system has a few thousand lines. Largest package has millions of lines. Not sure what they do. Perhaps billing or reporting.

q: can u use a function in a view definition?
q: what if a select-into returns 0 or more than 1 row? What’s the best practice
q: a pl/sql trigger can be defined for a ROW or a TABLE. meaning?
q: what builtin packages have you used?
A: DBMS_XSLprocessor, dbms_output, utl_file, dbms_job

q34: what’s your largest pl/sql package
q7: have you used pl/sql functions with views?
q: how did you choose between global var and param-passing@@
q: common exceptions@@
A: “when no_data_found then ..”, “when zero_divide then ..” Note that %NOTFOUND is a cursor attribute and not an exception used in “when..then”