-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate JMS Master Slave issue
PostPosted: Mon Feb 09, 2015 12:55 pm 
Newbie

Joined: Fri Feb 06, 2015 11:22 am
Posts: 3
Hi ,
I am implementing the JMS Master/Slave and getting this exception in logs. So far I have the setup only the slave implementation

Quote:
Caused by: com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1019: The connection is closed. The application attempted to use a JMS connection after it had closed the connection. Modify the application so that it closes the JMS connection only after it has finished using the connection.
[err] at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:149)
[err] at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:86)
...

I have debugged the source code of hibernate and have found that the Queue connection is initialized properly and the flag isClosed=false. But by the time the flow comes inside JmsBackendQueueTask's run() the call to the same JndiJMSBackendQueueProcessor.getConnection() results in a connection that has the isClosed=true and hence the queue session creation results in the above error.
So I am unable to understand what causes this flag to set to true after it was initialized correctly.If I set this flag value during debug to false the index messages are sent out to the Queue and I can see them. Here is how my hibernate.cfg.xml looks like -
Quote:
<property name="hibernate.search.default.sourceBase">/searchMaster/Climgmt/indexes</property>
<property name="hibernate.search.default.indexBase">/search/Climgmt/indexes</property>
<property name="hibernate.default_schema">CLI_MANG</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.jdbc.batch_size">20</property>
<property name="hibernate.search.default.refresh">800</property>
<property name="hibernate.search.default.retry_initialize_period">15</property>
<property name="hibernate.search.default.directory_provider">filesystem-slave</property>
<property name="hibernate.search.default.indexwriter.ram_buffer_size">10</property>
<property name="hibernate.search.default.indexwriter.merge_max_optimize_size">7</property>
<property name="hibernate.search.default.indexwriter.merge_max_size">7</property>
<property name="hibernate.search.default.worker.backend">jms</property>
<property name="hibernate.search.default.worker.jms.connection_factory">jms/cmsQueueCF</property>
<property name="hibernate.search.default.worker.jms.queue">jms/cmsQueue</property>
<property name="hibernate.search.default.worker.execution">sync</property>
<property name="hibernate.cache.region.factory_class">
org.hibernate.cache.ehcache.EhCacheRegionFactory
</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="net.sf.ehcache.configurationResourceName">/ehcache_cms.xml</property>


I am using locally Websphere Liberty Profile 8.5.5 and WMQ for Queue implementation.

Thanks
Abhishek


Top
 Profile  
 
 Post subject: Re: Hibernate JMS Master Slave issue
PostPosted: Tue Feb 10, 2015 8:57 pm 
Newbie

Joined: Fri Feb 06, 2015 11:22 am
Posts: 3
Also the hibernate jars I am using are these...
Quote:
Maven: org.hibernate:hibernate-search-backend-jms:5.0.0.Alpha7
Maven: org.hibernate:hibernate-search-engine:5.0.0.Alpha7
Maven: org.hibernate:hibernate-search-orm:5.0.0.Alpha7
Maven: org.hibernate:hibernate-search-serialization-avro:5.0.0.Alpha7

Are these jars the stable ones that I should use?

Also I found out that the Queue connection for writing indexes gets closed upon any transaction.commit(). So the first time upon BackendQueueProcessor initialization the queue connection remains open and on transaction commit the index changes are sent to the queue. The Queue connection is then closed. But the second time because the BackendQueueProcessor initialization code will not be called as its one time operation so the queue connection remains closed. Is the backend processor not suppose to use the connection pool to get a new active connection ? Why does it not do that even after specifying the pool size in hibernate.cfg.xml ?
Quote:
<property name="hibernate.search.default.worker.execution">async</property>
<property name="hibernate.search.default.worker.thread_pool.size">10</property>
<property name="hibernate.search.default.worker.buffer_queue.max">50</property>


And FYI we are using BMT and so beginning and committing the transactions manually .This is what is configured in hibernate.properties for the Websphere platform

Quote:
hibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform
hibernate.transaction.factory_class=org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory


So any help is appreciated.

Thanks
Abhishek


Top
 Profile  
 
 Post subject: Re: Hibernate JMS Master Slave issue
PostPosted: Wed Feb 11, 2015 6:23 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
the version you are using is not the latest one and they are Alpha,
you can try with version 5.0.1.Final


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