-->
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.  [ 11 posts ] 
Author Message
 Post subject: System held in insert sql command using ejb
PostPosted: Wed Sep 21, 2005 4:33 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Hibernate3 rc1

Mapping documents:

Code:
    <property name="hibernate.dialect">br.com.glr.populis.util.compatibility.SQLServer7Dialect</property>
    <property name="hibernate.connection.datasource">jdbc/dsPOPULIS</property>
    <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
    <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
    <property name="hibernate.cglib.use_reflection_optimizer">false</property>
    <property name="hibernate.transaction.flush_before_completion">true</property>
    <property name="hibernate.transaction.auto_close_session">true</property>




Code between sessionFactory.openSession() and session.close():

using jbpm product! but i need some sample to use hibernate with CMTTransaction or JTATransaction and want to know the exact difference betwen both

Full stack trace of any exception that occurs:
Code:
584609 DEBUG ctx:[[businessdelegate=WorkflowBusinessDelegate.java, method=publicarProcesso(processVo)] [sessionFacade=WorkflowSessionFacadeBean.java, method=publicarProcesso(processVo)] [classe=MainWorkflow.java, method=deployProcessDefinition(zipInputStream)]] - iniciando metodo: MainWorkflow.java::deployProcessDefinition(zipInputStream)
Hibernate: insert into JBPM_PROCESSDEFINITION (NAME_, VERSION_, ISTERMINATIONIMPLICIT_, STARTSTATE_) values (?, ?, ?, ?)
[21/09/05 17:31:44:359 GMT-03:00] 309c5a6f TimeoutManage I WTRN0006W: A transação 57415344:00000000000005f80000002198b3760cfdf004abcd7f11f58ece1a019447295f73657276657231[] atingiu o tempo limite após 120 segundos.


Name and version of the database you are using:
MSSqlServer 7 with an extended class that removes 'scope_identity" from sql command

The generated SQL (show_sql=true):

Code:
insert into JBPM_PROCESSDEFINITION (NAME_, VERSION_, ISTERMINATIONIMPLICIT_, STARTSTATE_) values (?, ?, ?, ?)


Debug level Hibernate log excerpt:

I'm using log4j in my application but the log of hibernate does not appear!

Code:
log4j.rootLogger=DEBUG, stdout, stderr

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%r %-5p ctx:[%x] - %m\n

log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.Target=System.err
log4j.appender.stderr.Threshold=ERROR
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern=%r %-5p ctx:[%x] - %m\n

log4j.logger.br.com.glr=DEBUG
log4j.logger.org.com.hibernate=DEBUG
log4j.logger.org.jbpm=DEBUG


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 1:39 am 
Pro
Pro

Joined: Fri Sep 02, 2005 4:21 am
Posts: 206
Location: Vienna
Only a minor hint, to help us help you:
mdonato wrote:
log4j.logger.org.com.hibernate=DEBUG

is wrong. it should be:
log4j.logger.org.hibernate=DEBUG

This way you'll be able to get Hibernate's debug information.

Erik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:04 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
ErikFK wrote:
Only a minor hint, to help us help you:
mdonato wrote:
log4j.logger.org.com.hibernate=DEBUG

is wrong. it should be:
log4j.logger.org.hibernate=DEBUG

This way you'll be able to get Hibernate's debug information.

Erik


All right, like i've suspected! Dont work!

Let me explain my entire context:

I'm using EJB2.0 Stateless SessionBean and i'm using de jbpm product of jboss.org that uses hibernate to make persistence on database, and i've readed the jbpm and hibernate documentation, and the jbpm documentatio said that i have to use hibernate3rc1, but i'm having troubles with transaction in hibernate.

My session bean uses a class named MainWorkFlow that is a singleton class that uses jbpm classes. and all (jbpm & hibernate) jar's are in the lib directory of container and i can't make hibernate to use CMT transactions, some times its hangs, some times it trows a null pointer exception and some times it do not found a connection to work with!

I've tried hibernate3, 3rc1 (this), and 3.1, but with no success!

I need the hibernate to work with CMT transaction, couse i need to make some persistences in my own tables at same process, with the same transaction for business data integrity.

My test environment is:
WebSphere 5.1
MSSqlServer 7.0
Hibernate 3*
Jbpm 3*

Code:
log4j.rootLogger=DEBUG, stdout, stderr
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%r %-5p ctx:[%x] - %m\n
log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.Target=System.err
log4j.appender.stderr.Threshold=ERROR
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern=%r %-5p ctx:[%x] - %m\n
log4j.logger.br.com.glr=DEBUG
log4j.logger.org.hibernate=DEBUG
log4j.logger.org.jbpm=DEBUG


this dont work

Please, i need a solution to this, couse i have to implement this feature in our product urgently.

Thanks for your replie


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:14 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
mdonato wrote:
Name and version of the database you are using:
MSSqlServer 7 with an extended class that removes 'scope_identity" from sql command


If you have identity columns, this might be your problem. Hibernate uses scope_identity() on insert statements if you have identity columns.

_________________
nathan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:16 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
nathanmoon wrote:
mdonato wrote:
Name and version of the database you are using:
MSSqlServer 7 with an extended class that removes 'scope_identity" from sql command


If you have identity columns, this might be your problem. Hibernate uses scope_identity() on insert statements if you have identity columns.



All right, and so ? what i've got to do to work with MSSQL7 ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:24 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Umm... don't remove scope_identity. :)

_________________
nathan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:28 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
If you have to remove scope_identity for some reason, but you can change your database, don't use identity columns and set your id generator to hilo, or something else.

_________________
nathan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:29 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
nathanmoon wrote:
Umm... don't remove scope_identity. :)


I've removed it couse the MSSQLServer7 does not recogonize this function! and i've readed in somewhere (that i dont remember now) that it could be removed from the sql command, but i dont think that its my problem, couse the table has a column identity, and mssql7 just autoincrement it at each insert!

Another suggestion ?

thanks for replie


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:32 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
I'm not familiar with SQL Server 7. I use 2000, and Hibernate uses scope_identity() on inserts with that version. Maybe Hibernate doesn't use scope_identity on 7, then. It was just a suggestion. Good luck.

_________________
nathan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 3:35 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
nathanmoon wrote:
I'm not familiar with SQL Server 7. I use 2000, and Hibernate uses scope_identity() on inserts with that version. Maybe Hibernate doesn't use scope_identity on 7, then. It was just a suggestion. Good luck.



Thanks for suggestions! but MSSQL7 does not have scope_identity() function, its a feature of MSSQL2000.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 8:15 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
I dont know what makes system held, but i made a lot of changes including changing the hibernate version, and i found a work around. Look at this topic http://forum.hibernate.org/viewtopic.php?t=947958

Thanks for replies


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.