Canot start transaction; no sessions are available
724381Oct 8 2009 — edited Oct 9 2009Hi all,
I'm currently encountered a problem using jolt session pool. I'm using the following code to instanciate the session :
public final class JoltSessionPoolManager {
private static Logger logger = Logger.getLogger(JoltSessionPoolManager.class);
private final SessionPoolManager manager;
public JoltSessionPoolManager(ServerProperties properties) {
manager = new SessionPoolManager();
String[] addrs = {"//192.168.1.10"};
String[] saddrs = {}; // No secondary address
UserInfo userInfo = new UserInfo();
userInfo.setUserName("");
userInfo.setUserPassword("");
userInfo.setUserRole("");
userInfo.setAppPassword("");
int joltPoolMinConnect = properties.getJoltPoolMaxConnect();
int joltPoolMaxConnect = properties.getJoltPoolMaxConnect();
// Creating default session pool :
manager.createSessionPool(addrs, saddrs, joltPoolMinConnect, joltPoolMaxConnect, userInfo, null);
}
public SessionPool getSessionPool() {
return manager.getSessionPool(null); // default session pool
}
public void stopSessionPool() {
manager.stopSessionPool(null);
}
}
Then I use Spring to instanciate this manager as a singleton bean :
<bean id="joltSessionPoolManager" class="fr.mdpa.util.dao.tuxedo.JoltSessionPoolManager" destroy-method="stopSessionPool"/>
Then I inject the jolt manager in my code and I use it like this in order to send Tuxedo requests :
SessionPool sessionPool = manager.getSessionPool();
Transaction transaction = sessionPool.startTransaction(joltTransactionTimeout);
DataSet dataSet = new DataSet();
dataSet.setValue("STRING",myQuery);
Result joltResult = sessionPool.call(query, dataSet, transaction);
// Get result :
String result= (String) joltResult.getValue("STRING", "");
So this works correctly during the first request. But if I don't use the connection pool during approximatively 20 seconds, it seems that the connection hang up and I get the following error :
"Ca not start transaction; no sessions are available"
My understanding of the connection pool is that it manages connections to tuxedo and when I request a connection, it provides it to me (if no connection is established, it should connect and the give me the connection).
Could you help me on this problem ? I'm using Tuxedo version 8.
Thanks in advance for your help.
Regards,
David.