-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: too many properties???
PostPosted: Fri Nov 14, 2003 4:54 pm 
Beginner
Beginner

Joined: Sun Oct 05, 2003 9:02 pm
Posts: 27
Location: New York, NY
After 12 hours of frustratingly tracking down the source of a runtime error, my observations seem to suggest that I have a mapping file with too many properties, as unlikely as that seems. The mapping file in question maps one class (plus two subclasses), and has a total of 44 properties.


Basically, if I remove any 7 or 8 properties the test scenario works fine. It doesn't matter which properties.

The runtime error I get occurs during a flush, or maybe during the commit. Based on other postings, this exception can occur when two properties map to the same column, but that is not the case here.

I'm at a dead end -- any help would be greatly appreciated. The exception is as follows:


-----------------

[11/14/03 15:36:49:623 EST] 58c445c8 ServerSession W WMSG0031E: Exception processing JMS Message for MDB CMSProductUsageReceiver, JMSDestination jms/CMSProductUsageReceiverQueue : java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java(Compiled Code))
at java.util.ArrayList.set(ArrayList.java:343)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.countParameter(WSJdbcPreparedStatement.java:355)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.setInt(WSJdbcPreparedStatement.java:1005)
at net.sf.hibernate.type.IntegerType.set(IntegerType.java:27)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:31)
at net.sf.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:33)
at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:371)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:476)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:454)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:20)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2100)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)

-----------------



And the mapping file for your viewing pleasure:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="forecastingModel.GenericUsage" table="generic_usage" discriminator-value="G">

<id name="genericUsageId" column="generic_Usage_Id" length="10" type="long">
<generator class="native"/>
</id>

<discriminator column="type" type="character"/>
<property name="actualPullRate" column="actual_pull_rate" type="float"/>
<property name="attritionRate" column="attrition_rate" type="float"/>
<property name="cmsPullRate" column="cms_pull_rate" type="float"/>
<property name="componentProductId" column="component_prod_id" type="string" length="10"/>
<property name="componentUsageId" column="compont_usage_id" type="string" length="14"/>
<property name="forecast" column="forecast" type="integer"/>
<property name="demandToCome" column="demand_to_come" type="integer"/>
<property name="forecastingPullRate" column="forecasting_pull_rate" type="float"/>
<property name="mailDate" column="mail_date" type="date"/>
<property name="daysIntoPromo" column="days_into_promo" type="integer"/>
<property name="materialNumber" column="material_number" type="string" length="18"/>
<property name="membersAddressed" column="members_addressed" type="integer"/>
<property name="overridePullRate" column="override_pull_rate" type="float"/>
<property name="overridePullLock" column="pull_lock" type="boolean"/>
<property name="pageSize" column="page_size" type="float"/>
<property name="pageSizeChangeFactor" column="pagesize_change_factor" type="float"/>
<property name="partialMatchSourceID" column="partial_match_source_id" type="string" length="10"/>
<property name="priceChangeFactor" column="price_change_factor" type="float"/>
<property name="salesToDate" column="sales_to_date" type="integer"/>
<property name="sequenceNumber" column="sequence_number" type="integer"/>
<property name="tunnelId" column="tunnel_id" type="string" length="10"/>
<property name="channel" column="channel" type="string" length="10"/>
<property name="clubPrice" column="club_price" type="float"/>
<property name="componentId" column="component_id" type="string" length="10"/>
<property name="componentType" column="component_type" type="string" length="10"/>
<property name="contentCode" column="content_code" type="string" length="10"/>
<property name="countAs" column="count_as" type="integer"/>
<property name="cutoverDate" column="cutover_date" type="date"/>
<property name="marketType" column="market_type" type="string" length="10"/>
<property name="packageId" column="package_id" type="string" length="10"/>
<property name="promoPeriodId" column="promo_period_id" type="string" length="4"/>
<property name="promoScheduleId" column="promo_schedule_id" type="string" length="4"/>
<property name="usageType" column="usage_type" type="string" length="10"/>
<property name="clubCode" column="club_code" type="string" length="4"/>
<property name="checkDigit" column="check_digit" type="string" length="10"/>
<property name="inventoryApprovalFlag" column="invt_approvl_flag" type="char" length="1"/>
<property name="inventoryApprovalReasonCode" column="int_flag_reason_code" type="string" length="2"/>
<many-to-one name="theTunnel" column="theTunnel" cascade="none"/>
<many-to-one name="theSC" column="the_sc" cascade="none"/>
<many-to-one name="theProduct" column="theProduct" cascade="none"/>

<subclass name="forecastingModel.CurrentMemberUsage" discriminator-value="C">
<property name="refusalToDate" column="refusal_to_date" type="integer"/>
<many-to-one name="theAutoshipment" class="forecastingModel.Autoshipment"/>
</subclass>

<subclass name="forecastingModel.NewMemberUsage" discriminator-value="N">
<property name="enrollToDate" column="enroll_to_date" type="integer"/>
</subclass>
</class>

</hibernate-mapping>
<!-- parsed in 16ms -->


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2003 7:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You are mistaken, of course.


Top
 Profile  
 
 Post subject: strange but true...
PostPosted: Fri Nov 14, 2003 8:29 pm 
Beginner
Beginner

Joined: Sun Oct 05, 2003 9:02 pm
Posts: 27
Location: New York, NY
mistaken, without a doubt....

nevertheless, i begin by removing properties one at a time, reexecuting the test case after each removal. It fails consistently until I've removed about 7 properties or so, and then it works. I can then add the last removed property back in, and it fails again.

I've done this 4 times now, choosing different properties each time, and each time, same results. Whatever the true underlying problem, it definitely is acting differently based on the number of properties in the mapping.

There has only been one other reference to this problem, and it was in the old forum archives. And, as might be expected, there was no resolution there.

Strangely, the problem only occurs on the second row inserted into the table. The test case runs through the first time with no problem (this was also noted in the reference in the old archive forum), and only fails on the second insert/flush.

In any case, at this point I've gone painstakingly through the Hibernate debug logs and the Hibernate source code, to no avail. It's exteremely difficult to debug given the behavior demonstrated by removing random properties and having the results change.

Brandon


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2003 8:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
How about running it outside the appserver. I notice that the exception occurs inside the WS connection pool code.


Top
 Profile  
 
 Post subject: no error logged
PostPosted: Fri Nov 14, 2003 8:46 pm 
Beginner
Beginner

Joined: Sun Oct 05, 2003 9:02 pm
Posts: 27
Location: New York, NY
i'll give that a try...probably not until I get back to work monday (unless i can manage to simulate it here)

i was going to mention that another difficult aspect of this is that there is no error displayed in the debug logs...everything seems to complete fine, and the log shows the session closing and hibernate transaction completing...after that the exception gets thrown, with no associated log statements.

i'll post the results after i've run it outside of websphere...

thanks


Top
 Profile  
 
 Post subject: interesting, and potentially problematic....
PostPosted: Fri Nov 14, 2003 9:08 pm 
Beginner
Beginner

Joined: Sun Oct 05, 2003 9:02 pm
Posts: 27
Location: New York, NY
was just looking back at the other known instance of this problem, and much to my dismay the other person was also using websphere...

their post can be found here:

http://forum.hibernate.org/old//904917.html

i'm in deep doo if this is some websphere specific limitation....


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2003 9:41 pm 
Newbie

Joined: Fri Nov 14, 2003 8:54 pm
Posts: 7
Location: Atlanta, GA, U.S.A.
Can't you just use a different JDBC connection pool / proxy, instead of using Websphere's custom implementation?

- Les


Top
 Profile  
 
 Post subject: good idea...
PostPosted: Sat Nov 15, 2003 10:24 am 
Beginner
Beginner

Joined: Sun Oct 05, 2003 9:02 pm
Posts: 27
Location: New York, NY
maybe i could try that, although i'm not too familiar with using a different connection pool in an app server (normally use the prepackaged one).

I was using the Hibernate connection management, but switched to websphere connection pooling with the expectation that it would be more scalable.

Any suggestions on on what other connection pool or proxy to use?

By the way, it appears it is a bug related to websphere, as others seem to be experiencing it under different situations.

http://groups.google.com/groups?q=java. ... com&rnum=4


Top
 Profile  
 
 Post subject: confirmed
PostPosted: Sat Nov 15, 2003 10:30 am 
Beginner
Beginner

Joined: Sun Oct 05, 2003 9:02 pm
Posts: 27
Location: New York, NY
looks like i can stick with the websphere pooling for now...

it's a confirmed websphere bug, and there is a hotfix available.

you can find the description here:

http://www-1.ibm.com/support/docview.ws ... us&lang=en


thanks everyone for the assistance....

brandon


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.