-->
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: Hibernate and Legasy System
PostPosted: Fri Oct 17, 2003 9:23 am 
Newbie

Joined: Fri Oct 17, 2003 8:56 am
Posts: 4
I am working with Progress Database accessed by J2ee technologies (with Jboss, hibernate, tomcat) which I am using, and Progress (webspeed).

The database system already exist, and I cannot change this structure. SO, I am using Middlegen to generate hibernate mappings and pojos classes. But, any table doesn

_________________
Rodrigo di Lorenzo Lopes
Analyst of System


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2003 9:48 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
But your data shall be distinguishablke somehow...
Is there possibility to create composite key?

May be introducing surrogate key...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2003 10:50 am 
Newbie

Joined: Fri Oct 17, 2003 8:56 am
Posts: 4
Using composite key will change anything in the database ?
How can i use surrogate key (like rowid) ?

_________________
Rodrigo di Lorenzo Lopes
Analyst of System


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2003 11:46 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
Well, if your data rows have unique field combination
which can serve as composite key - you are kind of fine.

Alternatively you could add ( if you can change database )
column and store unique IDs there.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 24, 2003 1:50 pm 
Newbie

Joined: Fri Oct 17, 2003 8:56 am
Posts: 4
Very well this solution (using composite-ids)

To try it, I have mounted the tables in Hypersonic SQL database source, I had been able to persist a pojo. But, when I had tried use Progress SQL, I have got this following message:

Quote:
15:26:09,085 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 22001
15:26:09,085 ERROR [JDBCExceptionReporter] [JDBC Progress Driver]:String data, right truncated. Error in parameter 18.
15:26:09,100 ERROR [JDBCExceptionReporter] Could not synchronize database state with session
java.sql.SQLException: [JDBC Progress Driver]:String data, right truncated. Error in parameter 18.
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.java:6562)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:6736)
at com.progress.sql.jdbc.JdbcProgress.SQLExecute(JdbcProgress.java:2790)
at com.progress.sql.jdbc.JdbcProgressPreparedStatement.execute(JdbcProgressPreparedStatement.java:238)
at com.progress.sql.jdbc.JdbcProgressPreparedStatement.executeUpdate(JdbcProgressPreparedStatement.java:144)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:308)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
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)
at br.com.toyota.dss.sessions.PersistencySessionBean.action(PersistencySessionBean.java:90)
at br.com.toyota.dss.sessions.PersistencySessionBean.add(PersistencySessionBean.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:738)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:383)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)


What must I do ?

_________________
Rodrigo di Lorenzo Lopes
Analyst of System


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 25, 2003 2:30 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
I am not sure about the last progress version, but looks like SQL/JDBC implementation can be better, we use JMS for integration with legacy progress applications and it works without problems. http://www.sonicsoftware.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 25, 2003 4:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
java.sql.SQLException: [JDBC Progress Driver]:String data, right truncated. Error in parameter 18


Usually this means that you tried to persist a String that was too long for the column it was destined for.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 28, 2003 12:28 pm 
Newbie

Joined: Fri Oct 17, 2003 8:56 am
Posts: 4
Thank you very much by your attention

I don

_________________
Rodrigo di Lorenzo Lopes
Analyst of System


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 28, 2003 7:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
FYI - The next release of Middlegen plugin r3 will generate a composite key over the complete table when there is no primary key on the table.


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.