nelson christos

Ranch Hand
+ Follow
since Aug 08, 2006
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nelson christos

Thanks for your reply Mark

The problem was with the OSIV filter mapping.
I had given singleSession as false
so it was creating a session on get* and another on save*. I changed it to
true and alls well
The controller function for saving the voyage

The service function is

and lastly the dao layer

I dont see any new session getting opened in here. Is this something to
do with transactions
These are the mapping files


I have a Voyage.hbm like this

<hibernate-mapping package="com.jmbaxi.model.agencyops">
<class name="com.jmbaxi.model.agencyops.Voyage" table="DAILY_VSL_DATA" lazy="false">
<id name="lineupNo" column="LINEUP_NO">
<generator class="assigned"></generator>

<join table="AOPS_VSLVOY_AUX_DTLS" optional="true">
<key column="LINEUP_NO"></key>

So when i am saving a voyage everything goes well
however when i added a
<set name="dailyCargo" inverse="true" order-by="REP_NO">
<key column="LINEUP_NO"></key>
<one-to-many class="DailyCargo"/>
it started giving me this exception

org.springframework.orm.hibernate3.HibernateSystemException: Illegal attempt to associate a collection with two open sessions; nested exception is org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions

i am using Spring OSIV filter.

I was wondering whether its a good idea to have a composite key in our table.
Our case is like this
A voyage can have a lot of dailyCargoReports associated to it.
Now the dailyCargoReport table can have 2 columns
voyage_id <pk>
sr_no <pk>
which represents the composite key
one id column represnting the PK and one FK to voyage_id

which is a better way to go for from hibernate perspective.

this is our first project in hibernate, so we are not going fully on a top down approach. we are creating the objects in UML and then we will be trying to create the tables in dB and later auto generate the hbm from ddl


[ March 28, 2008: Message edited by: nelson christos ]
you have to get hibernate tools plugin.
This might help you
In the previous post BULK and TANKER are 2 types of cargo and
HATCH is associated only to bulk

we are using Hibernate and came up with a model like this.
Each Vessel
---- has a Set of Positions
----------Each Position has a Set of Hatches.

So three tables to represent this . This looks fine.
However the the data to be stored differs on cargo type.
If it is a bulk cargo we have hatches , for petrol we have no hatches.

^ ^
| |

bulk and tanker are two categories of info we need to store
Should we go for table per class hierarchy to store both BULK AND TANKER
using a discriminator or go for table per subclass.

I need to create a table for the data being captured. The data is captured in the following format.

This data is for each vessel

SrNo LoadingPosition Hatch1 Hatch2 Hatch3 Hatch4 Hatch5 Total

These are the details i need to store for different hatches and the hatches
are dynamic depending on the vessel. I need a data model or some object model to represent this.

Thanks in advance
i have a inheritance hierarchy like this


and there is one table Employee representing all the information.
when i am trying to map Employee.hbm its saying that no discriminator
found for Assessee (single table per class). I am not sure whether to put a dcriminator column(Employee_Type) in database because the type might change at runtime. Is there a other way to do it without discriminator.

when installing oracle 10g its getting installed onto /usr/lib directory.
can i install that onto some other directory
17 years ago
thanks stephen, you got the point.
about dreamweaver, before getting started i needed
to know whether i being a beginner, can i leran to use it fast

Originally posted by Roger F. Gay:
OK. Now you're really leaving me confused. The next question is whether or not you actually want client side html - I mean, interacting in a sophisticated way with your back-end processes. Or is your html page just supposed to look good and have the occassional response to click sort of thing: do you rely on JSP for anything up-scale?

i didnt get what it means by "JSP for anything up-scale".
we are using jsp' for rendering our html response' back to the client.
and it contains lots of operations to do. like we create CRM applications,
appraisal there you go, its not that confusing
we are a team of 3 to 4 java programmers who are developing inhouse softwares.we dont have much of html expereince. much of our time is spend on creating buisness logic. and our projects are not that huge too. so we dont have too much time to spend on html coding. we surely meeting the deadlines but you know the end result(look and feel) is okey we would like to get the design fast and good as possible so that we can do the programming stuff. thanks