on 06-21-2004 10:29 AM
Hi,
I'm coding an entitity bean. I've tried to use the SAP table locking API. Im sure to specify a valid database and a valid table name. But when I call the lock method I get a technicalLockexception : "table telefon not in catalog". What's the problem?
Here is my code:
if (lockConnection == null) {
lockConnection =
DriverManager.getConnection(
"jdbc:mysql://pc2079/was?user=root&password=pass");
}
if (initialContext == null) {
initialContext = new InitialContext();
}
if (locking == null) {
locking =
(TableLocking) initialContext.lookup(
TableLocking.JNDI_NAME);
}
Map pkMap = new HashMap();
pkMap.put("STAMMNR", new Integer( 3));
locking.lock(
TableLocking.LIFETIME_TRANSACTION,
lockConnection,
"telefon",
pkMap,
TableLocking.MODE_EXCLUSIVE_CUMULATIVE);
} catch (TechnicalLockException ex) {
return false;
} catch (LockException ex) {
return false;
} catch (Exception e) {
e.printStackTrace();
}
Tia.
Regards,
Werner
Hi Werner,
I'm a hundred percent sure that this is the problem, but I think that you need to get the database connection from a DataSource, which you have previously registered in JDBC Connector Service in the J2EE Engine.
Zornitsa
P.S. You can find more information about registering a DataSource at http://help.sap.com/saphelp_nw04/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.