File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes ojdbc14.jar, batch update problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ojdbc14.jar, batch update problem" Watch "ojdbc14.jar, batch update problem" New topic
Author

ojdbc14.jar, batch update problem

Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
Hi Ranchers,
i am using oracle 9.2.0.6.0, and using ojdbc14.jar for accessing in my java program. i have some process to be run which has batch update.
sometimes when i run these process, i get exception which is pasted below.



The occurance is very very rare. i dont have any idea in which case its coming. i tried to follow this up, but sometimes it doesnt come for days and suddenly this problem may come.

I tried googling and am not able to figure out the solution for this.
please help...
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
It's difficult to tell without looking at the code, it must not to be difficult to debug NullPointerException. You need to closly look at

com.infy.cis.common.dbmgr.SRMTransMgr.makePrepStatement(SRMTransMgr.java:886)

this method. Put a debug statement to print all the values that are bounded to the SQL, mostly one of the parameter will be "null". If so then you need to fix this by calling setNull(int,int) api of the prepared statement to actually set the null value.
Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
Actually i found that there was a problem in ojdbc14.jar which gives the same error. so i was thinking if this could be because of that.

And there can be no null values for this update statement since this is working in most cases and not working in only very rare conditions.
and in each case, its only one value thts updated.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

I've seen Oracle errors like this before and the best you can do is try to determine why its occurring and avoid it if you can. Often its a concurrency issue.


My Blog: Down Home Country Coding with Scott Selikoff
Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
Actually i cant avoid that execute batch since that block needs to be processed for all the applications. thats where the update happens to DB after processing.

Now can i set some where the max batch size in DB so that even though i have a batch update, only one record is picked at a time.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

By avoid, I meant determine the root cause of the problem. Usually there is some specific data issue that will reproduce it.
Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
Hi
Even i taught so. But when i try to re run the same record without changing anything, the process goes thro and is saved to DB. only in this case, only one record is processed instead of a batch.
 
 
subject: ojdbc14.jar, batch update problem
 
Similar Threads
How to create jar file for application using JNI?
ORACLE DRIVER
Calling Stored Procedures from Spring
JBoss hangs while trying to retrieve Entity bean values
oracle.jdbc.driver.OracleCallableStatement is not public in OJDBC5.jar