yes i am serializing the ShoppingBasketBean,

regarding sesond problem (versionId problem) 
i am changing Orderdata, ItemData ..etc from class file to Collection
i.e new ShoppingBasketBean is a collection of ArrayLists.
but my main consern is performance with persistang the Collection into
database.


Narendranatha R Sajjala,
1800flowers.com
Ph:516-237-4881



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 6:11 PM
To: [EMAIL PROTECTED]
Subject: Re: ShoppingBasket persistence problem


>>>>> "Narendranatha" == Narendranatha R Sajjala <Narendranatha> writes:

    Narendranatha> persisting Shoppingbasket as a Blob object is decreasing
the performance,
    Narendranatha> any one can give a better idea about alternative for
this.
    Narendranatha> At present blob object contains ShoppingBasketBean
    Narendranatha> it is a collection of 
    Narendranatha> 1)shopperId
    Narendranatha> 2)OrderData
    Narendranatha> 3)ItemData
    Narendranatha> 4)RecipientData
    Narendranatha> 5)BillingMessage
    Narendranatha> 6)SoldToMessage

    Narendranatha> as per the business requirements we need to persist this
Object in database
    Narendranatha> everytime user add an item to basket 
    Narendranatha> so if user adds 10 items to shopping basket it results 1
INSERT and 9 UPDATE
    Narendranatha> statements against database using blob object.

    Narendranatha> another problem is one of the object is changes for
example added a new
    Narendranatha> field into ItemData.java as per business requirements
    Narendranatha> i am getting ClassCastException versionID is changed.

So you're serializing a bean into a db BLOB?

I would consider these alternatives:

1. Change the requirements.  Don't persist baskets to the db.  In some
scenarios, this would be a reasonable decision, but not in others.

2. Don't use a BLOB, define a normal database table.

3. Persist baskets to a simpler database, like a file system.

Do you understand why you're getting the "versionID" error?  This is
directly
because of your change to the class.  You might consider hardcoding the
serialVersionID in the class.  Supposedly, this will slightly increase
performance, although you would now have the responsibility to manage
changes
to it correctly.

-- 
===================================================================
David M. Karr          ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to