Skip to main content

Posts

Showing posts from October, 2013

Sheesh kebab recipe

Serving : 4

Lamb    : 1.5 lb
Yogurt  : 1 cup
Black pepper: 1 tsp
Olive oil       : 3 tbsp
Kothmir       : 3 tbsp
Garlic          : 2 cloves
Salt              : 1 tsp
Onion          : 1
Oregano      :
Red pepper flakes : 2 tsp


6 garlic cloves, crushed3 tablespoons extra-virgin olive oil, plus more for brushing3 tablespoons fresh lemon juice1 teaspoon kosher salt1 teaspoon freshly ground pepper1 teaspoon dried mint1 teaspoon dried oregano1 1/2 pounds trimmed boneless leg of lamb, cut into 1 1/2-inch cubes1 small bunch of fresh mint1 large red onion, cut into 2-inch pieces1 large yellow bell pepper, cut into 2-inch pieces1 large green bell pepper, cut into 2-inch piecesVegetable oil, for the grill

Java Transactions

ACID:
Atomicity: Either should commit all rollback all of its updates in a single unit of work.
Consistency: database should never be left in inconsistent state
Isolation: How protected is uncommitted changes from other transactions, isolation decreases concurrency.
Durability: changes are permanent.

interfaces
UserTransaction begin(), commit(), rollback(), getStatus()
TransactionManager suspend(), resume(), setRollbackOnly(),
Status ACTIVE, COMMITTED, COMMITING, MARKED_ROLLBACK, NO_TRANSACTION, PREPARED, PREPARING, ROLLEDBACK, ROLLING_BACK, UNKNOWN.

Transaction Models

1. Local
2. Programatic
3. Declarative

Local Transaction Model:
Resource manager manages transactions. Developer manages connections.
e.g.
conn.setAutoCommit(false);
try {
  stmt.executeUpdate(sql1);
  stmt.executeUpdate(sql1);
  conn.commit()
} catch (Exception e) {
  conn.rollback();
}

Programatic Transaction Model
Uses JTA, developer uses UserTransaction begin(), commit() or rollback().
UserTransaction tx
tx.begin()
tx…

JVM internals

JRE has JVM, Garbage collector, JIT compiler

JVM - young generation, old generation, permanent generation (metaspace).

Garbage collector - Serial, Multithreaded, CMS, G1

Serial
          - single threaded stop the world young generation collector
          - single threaded stop the world old generation collector

Throughput/Parallel/Multithreaded -
         - Multithreaded stop the world young generation collector
         - Single/multi threaded stop the world old generation collector

CMS
       - Server class machine default collector
       - Multithreaded young & old generation collector
       - 2 GB
       - 2 Virtual CPU's
       - One exception is on Windows 32 bit the default is the serial collector.

G1
     - Supported as of Java HotSpot 7 update 4
     - Region based multithreaded stop the world young generation collector
     - Combination of a mostly concurrent and stop the world old generation collector

JIT Compiler
     - Takes Java bytecode and generates native …