SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: session is closed hibernate exception while reindexing

This question is answered.


Permlink Replies: 67 - Pages: 5 [ 1 2 3 4 5 | Next ] - Last Post: Dec 3, 2011 4:30 AM Last Post By: longchamp
Jiri Sedlacek

Posts: 7
Registered: 3/11/09
session is closed hibernate exception while reindexing
Posted: Mar 11, 2009 2:43 PM
 
  Click to reply to this thread Reply
Attachment applicationContext.xml (7.4 KB)
Attachment app.log (569.4 KB)
Hi all,

in our application we have a strange problem - during reindexing org.hibernate.SessionException is thrown with message "Session is closed". I don't know where the problem can be :-( Reindexing is called from CompassIndexController.

I'm attaching file with related spring configuration and tomcat log, with DEBUG enabled for org.hibernate.* packages and for org.compass.* packages, any help or advice will be appreciated, if I can add some other information, please leave a message.

Best regards,
Jiri Sedlacek
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: session is closed hibernate exception while reindexing
Posted: Mar 11, 2009 3:33 PM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
 
  Click to reply to this thread Reply
Can you try and remove the SpringSyncTransactionGpsDeviceWrapper and just use the hibernateGpsDevice directly with the SingleCompassGps? Also, which version of Compass are you using?
Jiri Sedlacek

Posts: 7
Registered: 3/11/09
Re: session is closed hibernate exception while reindexing
Posted: Mar 11, 2009 6:24 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Attachment app2.log (873 bytes)
Version of compass is 2.0.2

Using just hibernateGpsDevice does not help.

One more question: if I use as a compass.transaction.factory LocalTransactionFactory and if I don't set transactionFactory to compassBean, reindexing is functioning, but if I run search, another error is thrown (attached).

I'm new to compass, so please excuse If I miss something important.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: session is closed hibernate exception while reindexing
Posted: Mar 12, 2009 8:00 AM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
 
  Click to reply to this thread Reply
Your original configuration is good (injecting the Spring transaction manger to the LocalCompassBean, and you don't have to set the SpringSyncTransactionFactory since it is automatically set when you inject the transaction manager).

Is there a chance that you can move to the latest Compass version (2.2 RC1), it will be much simpler for me to support you when you use it.
Jiri Sedlacek

Posts: 7
Registered: 3/11/09
Re: session is closed hibernate exception while reindexing
Posted: Mar 12, 2009 9:12 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
I'll try the newest version and post result here.
Thank you for now, Shay
Jiri Sedlacek

Posts: 7
Registered: 3/11/09
Re: session is closed hibernate exception while reindexing
Posted: Mar 12, 2009 3:33 PM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
 
  Click to reply to this thread Reply
I tried the 2.2.0-RC1 version and problem is the same. If I can provide some other information for you to understand my problem, please let me know.

Another thing: As I wrote before about using the LocalTransactionFactory,with version 2.2.0-RC1 a receive CompassException with message "Trying to execute a query without an attached session, have you called attach on the query?". How can I create a Compass query with attached session inside? The code in our project (not writen by me) is now this:

CompassQuery compassQuery = (CompassQuery)getCompassTemplate().execute(new CompassCallback() {

public CompassQuery doInCompass(CompassSession session) {
CompassQueryBuilder queryBuilder = session.queryBuilder();
CompassQuery compassQuery = queryBuilder.queryString(myQuery).toQuery();
compassQuery.attach(session);
if (relevance) {
compassQuery.addSort(SortImplicitType.SCORE, SortDirection.AUTO);
} else {
compassQuery.addSort("date", CompassQuery.SortPropertyType.INT, SortDirection.REVERSE);
}
return compassQuery;
}
});

The bold line was added by me, but it didn't solve the exception.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: session is closed hibernate exception while reindexing
Posted: Mar 13, 2009 4:14 PM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
Helpful
  Click to reply to this thread Reply
The attach exception is strange. What do you do with the CompassQuery after you create it in the CompassTemplate callback? Is it executed within the same opened session?

Regarding the first problem (and optionally, for me to nail down the second attach problem), is there a chance that you can create a simple test case to recreate it? Hopefully running against an embedded database like HSQL?
Jiri Sedlacek

Posts: 7
Registered: 3/11/09
Re: session is closed hibernate exception while reindexing
Posted: Mar 16, 2009 11:51 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Search was called on CompassSearchHelper object outside of the compassTemplate callback, after moving it inside it's ok, thank you.

For the first problem I'll try to create a simple test case and I'll post it here.
Jiri Sedlacek

Posts: 7
Registered: 3/11/09
Re: session is closed hibernate exception while reindexing
Posted: Mar 28, 2009 4:09 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Attachment test.zip (984.2 KB)
Sorry for my late response, in attachment you can find zip file with test case. I tried to do it as simple as I can, it reproduce the error we are getting.

In archive you will find simple maven project, to run it, please unzip it to some directory, run hsqldb with the command server.bat or server.sh, then you have to run the maven goal for create db:

mvn -Pdatabase clean compile antrun:run sql:execute dbunit:operation


then please create jar by the goal

mvn clean compile package


and now you can use war archive generated in target directory to deploy to tomcat-5.5 (this is one I tested with).

Then use the url http://<server>:<port>/<context>/reindex and click the button "Reindex", you should see the exception stacktrace.

If you discover what is wrong, We will be very glad of it.

If there is something wrong with archive, please let me know, I will try to fix it. The source code used in test-case is the smallest part of our project I considered relevant, so If you will see some comments in strange language, it's czech:)

Thanks very much, I am looking forward for your advice or solution.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: session is closed hibernate exception while reindexing
Posted: Mar 29, 2009 3:12 PM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
Correct
  Click to reply to this thread Reply
Hi,

I ran the test you provided and I think I found the problem. You have a Hibernate transaction interceptor that intercepts all the beans that end with Manager. The problem is that the Spring transactionManager also ends with Manager :). I don't think you really want to intercept the transaction manager, but your business logic. This is the thing that messes Compass up (and other services, potentially, if they do what Compass does, which is pretty common).

Once I changed the transactionManager bean to be named transactionManagerX, all worked fine.

Cheers,
Shay
Jiri Sedlacek

Posts: 7
Registered: 3/11/09
Re: session is closed hibernate exception while reindexing
Posted: Mar 30, 2009 1:21 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Yes, renaming transactionManager helps. Thank you for your time, You help us very much.

Best regards,

Jiri Sedlacek
rayban

Posts: 3
Registered: 7/23/11
Re: session is closed hibernate exception while reindexing
Posted: Jul 23, 2011 2:20 AM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
 
  Click to reply to this thread Reply
Since 1973, ray ban sale have been outfitting standard Joes and stars as well with their fashionable and very helpful collection of ray ban sunglasses. Nonetheless, its ray ban appeal to actors and musicians which have created the ray ban 3025 eyeglasses like a whole lot an icon since the figures they adorn. think about it, would the Blues bros occur to get precisely the same with out placing on their ray ban 2140? have you been in a location to photo Tom Cruise's Maverick character in major Gun with out possessing his ray ban 2143 Aviator sunglasses?Are you frustrated whenever you compensated huge bucks for any pair of louboutin uk after which discovered the fact that louboutin footwear are fake and also the high quality is bad? This time the writer is heading to reveal some knowledge with you regarding how to distinguish superior and actual louboutin shoes, so the up coming time whenever you are buying footwear you can refrain from poor productions.Most within the Christian Louboutin footwear are created of organic leather, so to distinguish the actual Christian Louboutin shoes; you need to very first know the way to distinguish the organic leather.
louisvuittonbox

Posts: 411
Registered: 8/23/11
Re: session is closed hibernate exception while reindexing
Posted: Aug 23, 2011 9:17 PM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
 
  Click to reply to this thread Reply
Welcome to visit our louis vuitton outlet store for more series of Louis Vuitton Products. You will find the most complete Louis Vuitton handbags such as Monogram wallets, Louis Vuitton Speedy 30, Damier Canvas. Here, You could choose whatever you want in our louis vuitton store! Louis Vuitton Handbags are one of most popular designer handbags brands throughout the world! our louis vuitton outlet are earnest to offer you the authentic louis vuitton travel which is made of the best material and with exquisite designs. Our coupon 5% is prepare for our dear customers if your order value exceed $80.And you can enjoy the same feeling and weight to the luxury louis vuitton as original one. You can surely get your desired cheap louis vuitton shoes at the lower price here. More Louis Vuitton on sale just in our louis vuitton online!
010s

Posts: 50
Registered: 9/9/11
UGG Classic Tall Boots cheap
Posted: Sep 9, 2011 9:18 PM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
 
  Click to reply to this thread Reply
The Tribe indicated that Antonetti would not be available for comment until after the completion of UGG Kensington Boots;indians manager Manny Acta also declined comment when asked about the deal following UGG Delaine Boots`UGG Highkoo Boots`UGG Sheepskin Cuff Boots`UGG Suburb Crochet Tall Boots the Royals on UGG Gissella Boots`UGG Corinth Boots`Men UGG Classic Short Boots`Classic UGG Boots saturday night.pomeranz is technically considered a "player to be named later" due to UGG Classic Tall Boots cheap`UGG Classic Short Boots`ugg cardy boots uk guidelines for trading recently drafted players.Since Pomeranz signed his first professional contract less than ugg cardy boots sale`UGG Bailey Button Boots`UGG Bailey Button Triplet Boots>`UGG Bailey Button Krinkle`women ugg boots sale,which is the signing deadline for Kids UGG Boots,During Jimenez's appearance, he surrendered a two-run double to UGG Earmuffs`UGG Gloves`UGG Handbags, who is Discounted ladies UGG Slippers`UGG Stripe Scarf on Cleveland's current wish list.
It seems that the parents are a little strict with their discount uggs.but on the other way,they are so open and considerate.They buy uk uggs|uk uggs sale to their uk uggs outlet|clearance jackets|cheap moncler jackets to play any moncler store online|moncler on sale|moncler for sale|moncler homme.They want to their children are not strong in the study but also have strong uggs on sale,You can understand how diligent parents are.They just do what they can do to creat a good enviroment for uggs UK|uggs outlet|clearance ugg,In order to let them grow happily and healthiely ;In the evening men moncler|moncler outlet|moncler coats you can see quite a lot of female dress up very cool in the plyground;nfl jerseys|cheap nfl jerseys worn in their bodies form a beautiful secene in the backgrond of the sunset;even though the weather is so hot , people still do exercise every day.As a result of it,Wholesale NFL Jerseys|nfl jerseys outlet|nfl jerseys on sale comfortable gym suit is actually important;In order to make you cool and handsome ,I advice all of you a kind of gym suits called nfl jerseys china,this sort of clothes are made specially for sportsman including those people who are crazy to sports.
feifei

Posts: 128
Registered: 9/5/11
Re: session is closed hibernate exception while reindexing
Posted: Sep 13, 2011 3:18 AM   in response to: Jiri Sedlacek in response to: Jiri Sedlacek
 
  Click to reply to this thread Reply
We are the best soccer jersey supplier, all the soccer jerseys on jerseybbs.com are REPLICA SOCCER JERSEYS, but their quality are good, because many soccer jersey shopping websites are selling our discount soccer jerseys, espcially the thailand quality cheap soccer jerseys, They are the same as the official jerseys

According to a figure that most of the luxury brands consumer in China range frome 2os to 30s.
wholesale polo shirts are all young Women's love, wearing the designers will attract passerby glance, it make them be in good mood all the day.

feidufang
With the increase in printing needs all over the world, manufacturers of Ink Cartridges are hard pressed to meet the ever-increasing demand. Consumer satisfaction ranks highest in the quest to fulfill company priorities. Buying printers is relatively cheap nowadays, but unfortunately, the Ecco Key West Mens same thing cannot be said about the CISS or cartridges that require to be replaced often.

cocogamer.com is one of most reliable sellers which engage in r4i gold and r4i sdhc , including all the most popular R4i and R4 3DS Cards at favorable price
China Ceramic Tile Manufacturer exporter and supplier with a factory in China, manufacture all kinds of Ceramic Tile, wall tiles, Floor Tiles!


The online store to buy replica Louis Vuitton bags, wallets and purse of top most designer

R4 Series,r4i Series,R4DS,R4i SDHC,R4i Gold,R4i Card for NDSi XL/NDSi/DSL/NDS - UseeGames.Com




Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums