aggressively releasing JDBC connection

2,103 views
Skip to first unread message

Kazz

unread,
May 16, 2011, 11:22:50 PM5/16/11
to arib...@googlegroups.com
Hello All,

This may not be AW issue (may be JPA issue) but I can't find solution for a few days.
If you have any insights or experiences, please advice.

Application seems to failed to connect database after first fetch.

The case is,

1. fetch departments
2. Use selected one of the departments fetched on UI
3. fetch persons belong to the department

But no persons are displayed.

Here is the debug log.
========================================================================================
12:04:43,254 DEBUG SQL:111 - select executed

12:04:43,260 DEBUG AbstractBatcher:426 - about to open ResultSet (open ResultSets: 0, globally: 0)

12:04:43,265 DEBUG AbstractBatcher:433 - about to close ResultSet (open ResultSets: 1, globally: 1)

12:04:43,269 DEBUG AbstractBatcher:418 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)

12:04:43,274 DEBUG ConnectionManager:427 - aggressively releasing JDBC connection
========================================================================================


I developed this app on Mac and tested on Mac, and found that it worked perfectly without "aggressively releasing JDBC connection" log message.
Then I deployed it on Linux (Ubuntu 10)  and encountered the problem.

App server is glassfish 3.0.1 and database is PostgreSQL 8.4.

Sorry for this wide distribution.

Kazz

Kazz

unread,
May 17, 2011, 10:53:57 PM5/17/11
to arib...@googlegroups.com
Sorry for my incorrect explanation.

On Mac, there are "agresssively releasing JDBC connect" log message.

When I got the issues (subsequent entity are not fetched), there seem that the entities referenced by (joined from) person entity are not resolved in Hibernate (JPA layer?).
Does this cause the problem?
Any solution?

The database schemas on Mac box and Linux box are identical.
Data in the databases are sometimes different because data are sometimes updated on Linux box.

Kingsley Ngan

unread,
May 18, 2011, 1:51:57 AM5/18/11
to arib...@googlegroups.com
Hi Kazz,

Maybe you can setting hibernate.connection.release_mode to
"after_transaction"

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html

Thanks,
Kingsley


--
You received this message because you are subscribed to the Google Groups "AribaWeb (aribaweb.org)" group.
To post to this group, send email to arib...@googlegroups.com.
To unsubscribe from this group, send email to aribaweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/aribaweb?hl=en.

Kazz

unread,
May 18, 2011, 5:37:59 AM5/18/11
to arib...@googlegroups.com
Hi Kingsley,

Thanks for response.

I set hibernate.connection.release_mode to "after_transaction" but couldn't get good result.


I compared logs on both mac and linux.
On mac, I can get the resultant rows but linux.

The differences are;

1. On mac, it shows 

Loader:1197 - result row: EntityKey[model.A#1]
Loader:1197 - result row: EntityKey[model.A#2]
Loader:1197 - result row: EntityKey[model.A#3]
Loader:1197 - result row: EntityKey[model.A#4]
....
....

after 

AbstractBatcher:426 - about to open ResultSet (open ResultSet: 0, globally: 0) 

But on linux, it shows 

AbstractBatcher:433 - about to close ResultSet (open ResultSet: 1, globally: 1)

right after

AbstractBatcher:426 - about to open ResultSet (open ResultSet: 0, globally: 0) 


2. On mac, it shows

TwoPhaseLoad:130 - resolving associations for [model.A#1]
TwoPhaseLoad:226 - done materializing entity [model.A#1]
....
....

entity model.A has one "toMany" association to entity model.B.
entity model.B has backward reference to model.A and another "toMany" association to entity model.C.
Those "toMany" associations are fetch+FetchType.LAZY and cascade=CascadeType.ALL.



Reply all
Reply to author
Forward
0 new messages