Hi<br>Are you suggesting we don't get the pool from jndi at all, or don't use the same one as the rest of the application?<br><br>Taariq<br><br><div class="gmail_quote">On Thu, May 26, 2011 at 11:37 AM, David Roussel <span dir="ltr"><<a href="mailto:nabble@diroussel.xsmail.com">nabble@diroussel.xsmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Don't let your application server manage your logging db connection. This may be harder than it sounds. I've had trouble in the past trying to convince weblogic that I didn't want XA transactions between two different databases.<br>
<div><div></div><div class="h5"><br>
On 26 May 2011, at 03:55, Alphy <<a href="mailto:binnyal@gmail.com">binnyal@gmail.com</a>> wrote:<br>
<br>
><br>
> I am using JNDIConnectionSource for writing logs to my postgres DB .But I am<br>
> facing a problem in transaction handling .<br>
><br>
> App Server : Glassfish.<br>
><br>
> In EJB , I have Stateteless Session Bean and I have<br>
> private static final Logger auditlog = LoggerFactory.getLogger("audit");<br>
><br>
> Inside I have method for transactions.<br>
><br>
> Bean{<br>
> Method(){<br>
> Method1();<br>
> Method2();<br>
> <a href="http://auditlog.info" target="_blank">auditlog.info</a>("method");<br>
> }<br>
> Method1()<br>
> {<br>
> em.persist();<br>
> <a href="http://auditlog.info" target="_blank">auditlog.info</a>("method1");<br>
><br>
> }<br>
> Method2()<br>
> {<br>
> em.persist();<br>
> <a href="http://auditlog.info" target="_blank">auditlog.info</a>("method2");<br>
><br>
> }<br>
> }<br>
><br>
> <appender name="DB" class="ch.qos.logback.classic.db.DBAppender"><br>
> <connectionSource class="ch.qos.logback.core.db.JNDIConnectionSource"><br>
><br>
> </connectionSource><br>
> </appender><br>
><br>
> I wanted Method1 and Method 2 in one transaction and if any failure need to<br>
> rollback both. Earlier when I was writing logs to file it was working fine<br>
> and now when I changed to Db, I realised the call to write logs is closing<br>
> existing transaction and starting new transaction to write to DB. Please let<br>
> me know how I can use the same transaction for writing to logs. I am using<br>
> same connection pool for both logging and application.<br>
> --<br>
> View this message in context: <a href="http://old.nabble.com/LogBack--JNDIConnectionSource-tp31704423p31704423.html" target="_blank">http://old.nabble.com/LogBack--JNDIConnectionSource-tp31704423p31704423.html</a><br>
> Sent from the Logback User mailing list archive at Nabble.com.<br>
><br>
> _______________________________________________<br>
> Logback-user mailing list<br>
> <a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
> <a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</div></div></blockquote></div><br>