I have a problem with the "long-lived" transaction in my ejb3 project, which
built in JBossAS4.0.4RC1 with install-component "all".
I found the file "persistence.properties" under "ejb3.deployer\META-INF" is
configurated by default like this:
hibernate.transaction.flush_before_completion=true
I think it supports not the "long-lived" transaction, because if i change this
"flush_before_completion" value to "false", it runs without problem with
"PersistenceContextType.EXTENDED"
(@PersistenceContext(unitName="...",type=PersistenceContextType.EXTENDED))
My problem is, in my "old" ejb3 project in JBossAS4.0.3SP1, i try to load the
"lazy fetch" Object in EntityBeans with the function like this:
| @ManyToOne(cascade={}, fetch=FetchType.LAZY)
| @JoinColumn(name="mandant_id", unique=false, nullable=true,
insertable=true, updatable=true)
| public InfondsMandant getMandant() {
| Hibernate.initialize(this.mandant);
| return this.mandant;
| }
|
and by default i dont need to configurate the file "persistence.properites" to
support the "long-lived" transaction.
But now if i want to load the "lazy fetch" Object with the funktion
"Hibernate.initialize()" under the configuration
"flush_before_completion=false("long-lived" support)", it throws the exception
"org.hibernate.LazyInitializationException: could not initialize proxy - no
Session".
And if i set the value of "flush_before_completion" back to "true", the
function "Hibernate.initialize(lazy)" runs but fine.
So now i cannt use the "long-lived transaction" and Hibernate.initialize(lazy)
together.
Someone knows that, how should i do, so that JBoss supports them both?
thanks alot for your helpers!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3924857#3924857
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3924857
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user