Re: [jboss-user] [jBPM] - Problem deploying on JBoss 5
by jack lista
jack lista [http://community.jboss.org/people/jackalista] replied to the discussion
"Problem deploying on JBoss 5"
To view the discussion, visit: http://community.jboss.org/message/557970#557970
--------------------------------------------------------------
Hi,
I have a tangentially realted issue, I am interested in sending MIME Multipart email messages through JBossESB EmailWiretap and was wondering if org.jboss.resteasy.plugins.providers.MimeMultipartProvider can be used to do so, foundthis post as this class is in the related stacktraces from the jbpm console issue you guys were working on.
Do any of you (more experienced folks especially) know if MIME Multipart emails can be sent via JBossESB EmailWiretap, and if this MimeMultipartProvider can be used to send them? Or if there's another approach, etc. No info in maunuals, have seen no specific posts, wiki articles or other related stuff.
Anyone know:
1. Is it possible to send these via EmailWiretap?
2. What is the right/best/workable approach?
-=j=-
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557970#557970]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
Re: [jboss-user] [Beginner's Corner] - JDBC inside CMT
by Wolf-Dieter Fink
Wolf-Dieter Fink [http://community.jboss.org/people/wdfink] replied to the discussion
"JDBC inside CMT"
To view the discussion, visit: http://community.jboss.org/message/557915#557915
--------------------------------------------------------------
Ok,
if you are using a DataSource and set explicit autocommit the result after return connection into the pool might be surprisingly because the connection will be reused.
We have some trouble in the past with 'non standard' solutions, it will become difficult in case of app-server upgrade or code changes.
But if I understand your scenario correct you do only some SELECTs vie JDBC, right?
If so, there is no necessity for autocommit.
I use JDBC also within CMT beans, I'll leave the connection unchanged and delegate the rollback to the container.
If a RuntimeException is thrown the container rollback for you.
If an Exception should thrown I force the rollback via <context>.setRollbackOnly()
So I prefere a transactional MDB and throw an Exception to rollback or delegate to a SLSB with Tx=RequiresNew.
Remember that all entity access must have a transaction, if no available the container will open one explicit (this can cause less performance)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557915#557915]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
[Beginner's Corner] - Why am I still seeing the HouseKeepingMessage ?
by Mads Moelgaard Andersen
Mads Moelgaard Andersen [http://community.jboss.org/people/mda_dk] created the discussion
"Why am I still seeing the HouseKeepingMessage ?"
To view the discussion, visit: http://community.jboss.org/message/557907#557907
--------------------------------------------------------------
Hi
I keep getting this "HouseKeeping" message for both connections and statements. and I don't understand why.
All my JDBC calls follow the same pattern:
public ArrayList<ObjectScore> getObjectIdsAndScore(long someLong, long anotherLong, long aThirdLong, String aString) throws Exception
{
ArrayList<ObjectScore> result = new ArrayList<ObjectScore>(500000);
ResultSet rs = null;
try
{
Connection conn = getConnection();
StringBuffer sql = new StringBuffer();
*** BUILDING SOME SQL ***
rs = executeSelect(conn, sql.toString(), fetchsize);
rs.beforeFirst();
while (rs.next())
result.add(new ObjectScore( rs.getLong(1), rs.getFloat(2)));
result.trimToSize();
}
catch (Exception e)
{
logger.error("getObjectIdsAndScore failed: "+e.getMessage());
throw e;
}
finally
{
try
{
if (rs.getStatement() != null) rs.getStatement().close();
}
catch (Exception ignored)
{
}
try
{
if (rs != null) rs.close();
rs = null;
}
catch (Exception ignored)
{
}
closeConnection();
}
return result;
}
Both getConnection() and closeConnection() are inherited methods.
public ResultSet executeSelect(Connection connection, String sql, int fsize) throws Exception
{
ResultSet rs = null;
try
{
sql = (sql.endsWith(";") ? sql.substring(0, sql
.length() - 1) : sql);
logger.info("SQL: " + sql);
Statement statement = connection.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
statement.setFetchSize(fsize);
rs = statement.executeQuery(sql);
}
catch (Exception e)
{
logger.error("executeSelect failed: "+e.getMessage());
throw e;
}
finally
{
}
return rs;
}
As you can see the first snippet opens and closes the connection. The second creates both the statement and the resultset where the first closes them both. Still I get WARNs like
14:01:47,320 WARN [WrappedConnection] Closing a result set you left open! Please close it yourself.
java.lang.Throwable: STACKTRACE
at org.jboss.resource.adapter.jdbc.WrappedStatement.registerResultSet(WrappedStatement.java:744)
at org.jboss.resource.adapter.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:217)
Pointing out the method for the first snippet.
I also get following when a MDB exits the onMessage method.
[CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@844674
I've already read
http://community.jboss.org/wiki/WhatDoesTheMessageDoYourOwnHousekeepingMean http://community.jboss.org/wiki/WhatDoesTheMessageDoYourOwnHousekeepingMean
and I guess my code pretty much follow the outlined pattern, so what is wrong?
Best regards
Mads M Andersen
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557907#557907]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months