maverickml venkatesh

Greenhorn
+ Follow
since Aug 17, 2011
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 maverickml venkatesh

Hi

This post is regarding a persistence issue with JPA. The JPA provider used is Oracle Toplink provided by weblogic 12c and is built using EclipseLink.

The user makes 'n' number of interactions/trasnactions and the app writes each transaction to the DB.
Under heavy load, while writing the transactions, the app is facing duplicate key exceptions.
The 1st transaction is written successfully to the DB but the subsequent transaction is sometimes rejected with the duplicate key exception.

As i said the app uses JPA 2.0 in which the shared cache is enabled by default and i think this is something to do with shared cache.
I say this because the same app works fine in Weblogic 10 which uses JPA 1.0 and there is no concept of shared cache in there.

Now back to the issue, Each entity that takes part in the insert transaction is uniquely identitified by an embedded primary key class with overridden
hashcode/equals() (Please see below for the class definition).




The primary key is the combination of sessionid(FIRST_USER_SESSION) and the transaction number (01 for first insert, 02 for second insert ....)
For e.g: FIRST_USER_SESSION and 01

1st transaction pk: FIRST_USER_SESSION01
2nd transaction pk: FIRST_USER_SESSION02


1. Before writing the 1st insert transaction(entity with pk FIRST_USER_SESSION 01), its checked in the L2 cache and since its not in cache , its
successfully persisted to DB.

2. After writing the first transaction , its updated in the L2 cache.(entity with FIRST_USER_SESSION 01 key is cached)

3. Now for the second insert transaction(the entity with key FIRST_USER_SESSION 02), the L2 cache is checked before persisting and and its my guess that
entity for second transaction is considered identical to the one already in L2 cache. Even though the pk is different (FIRST_USER_SESSION02), i think the
framework identifies it as the duplicate object.(based on the equals() and hashcode() overridden) . As a result the same duplicate object is attempted for insert and dulicate key exception is thrown.


Question 1) Is my understanding correct
Question 2) If this is the case, can i make the entity to use isolated cache and refresh always and expire instantly(like highlighted below).
I just want the cache to be disabled for this entity, Please let me know your comments





I have the following XSD with elementFormDefault = "unqualified"



While marshalling using jaxb am getting a xmlns:ns="" for the RefundRequest element



The issue is happening only in weblogic12c and not in WEblogic 10. The jaxb jar used is javax.xml.bind_2.1.1.jar

How can i remove the xmlns:ns0 ="" from the marshalled XML
Issue
Application migration to 12c and jaxb is not working on it

Description
The application is currently on Weblogic 10 and consumes some webservices. We post the XML directly to the webservice using HttpURLConnection. Before posting we marshal the request and after receiving the response we unmarshall them

The app needs to be migrated on 12c and when we tested the app on 12c , it was not working the same. The request that was sent to the webservice had a difference.Please see below the schema, java classes and marshalled request

Refund.xsd
----------
<!-- Request and DeliveryNumber attributes her -->

Generated the Refund.java and related classes using Eclipse-->Generate--> JAxB classes. am behind a firewall and in teh JAXB wizard it did ask me for a proxy. I didnt provide any poxy. Generted class

Refund.java



Am marshalling the object to XML(see below) and passing it to the web service . Web service returns "XML not well formed"

App Library



Code Snippet


Lookng at the logs , i could see the teh following marshalled request on weblogic 12c. There is an xmlns:ns0="" which i think is creating the problem

**Marshalled Request - not working one when tried in weblogic 12c jrockit160_29 .**

Need to get rid of the xmlns:ns0="" below




Marshalled Request in Weblogic 10 (existing working version in weblogic 10 jrockit160_29[/code]--------------------------------------------------------------------------------


when the Request does nto contain <RefundRequest xmlns:ns0=""> it works perfectly.
Trying to invoke a webservice usign the AXIS genereated client stubs .

When i run my standalone axis2 client program am getting exception

. The getPolicy() method in the axis generated stub class

Why is that am getting NullPointerException?

I tried splitting the code like below. But still getting teh same NullPointerException



Has anyone faced this kind of error ? Any advice is highly appreciated.
10 years ago
Hi,

Sorry if I had posted this in the wrong forum.

I have a webpage with links in a table. All i need to do is to navigate to each of these links and gather information from those pages.

As of now i can think of writing web crawler in java (again this has to be supported by the site)

Any other solutions like collecting the webpage response and HTML parsing the same.

Please suggest
12 years ago