search
attachments
weblink
advanced
tooltip
Overview
Content Tools
There's a writeup on how Spring does this:
http://static.springsource.org/spring-security/site/docs/3.0.x/reference/domain-acls.html
There's a Safari on-line e-book available for java RESTful services
RESTful Java with JAX-RS is available for reading online.
Strategies for long queries and RESTful services
I was thinking of adding a ConcurrentHashMap/AtomicInterger to a given service for very get requests.
The idea and strategy is this:
- For requests we think might take a long time, we start a new Asynchronous query. These requests shouldn't be requests that are performed very often. This query is assigned a new AtomicInteger.
- When the query executes, we set a timer, maybe 10 seconds. If the query finishes, we just return the result like normal.
- If the query doesn't finish, however, we create a new AsyncQueryStatus object and added to the ConcurrentHashMap with the key being the AtomicInteger. We then return that status object.
- The client can poll to a new REST resource which corresponds to the ConcurrentHashMap for status. While the query is still executing, the same status will be returned.
- When the query is finished, the status in the ConcurrentHashMap is updated and the original object is added.
- The client gets the result on the next polling.
Just some thoughts.
Getting your bind variables back
- Get a heap dump.
- For the pipeline:
- Hook up jconsole to the instance
- select com.sun.management
- select operations
- click on dumpHeap. The dump will be local to java instance you connected to, put in a file name, and click true.
- Transfer that file back to your computer
- For the pipeline:
- Open up the heap dump in Netbeans
- Go to Profile -> Load Heap Dump
- Select your heap dump
- Find your statements with OQL:
- For prepared statements use:
select {instance: sql, content: sql.sqlObject.odbc_sql.toString()} from oracle.jdbc.driver.T2CPreparedStatement sql - For callable statements (i.e. stored procedures) use:
select {instance: sql, content: sql.sqlObject.odbc_sql.toString()} from oracle.jdbc.driver.T2CCallableStatement sql
- For prepared statements use:
- For the prepared statements, take a look at the content. The content should be the sql you are looking for.
- You're going to have to look through the bind variables in the T2C*Statement. Usually called lastBound* or boundInt, boundLong, etc...