Subject Exceptioin when using connection in distributed transaction in Java Application server

This exception I get when I try to close connection that I get from a Datasource that I lookup from JNDI.

I use

try {
  // Some code that uses connection
} finally {

11:58:47,160 ERROR [STDERR] Caused by: org.firebirdsql.jdbc.FBSQLException: Connection enlisted in distributed transacti
11:58:47,160 ERROR [STDERR]     at org.firebirdsql.jdbc.AbstractConnection.setAutoCommit(
11:58:47,160 ERROR [STDERR]     at org.firebirdsql.jdbc.AbstractConnection.close(
11:58:47,160 ERROR [STDERR]     at com.dsoft.framework.enterprise.session.LoginManagerBean.initializeAdminAccount(LoginM
11:58:47,160 ERROR [STDERR]     ... 162 more

Is there anything I can do to avoid this?