Hi Sahuly,
I'm not entirely sure if this will answer your question as I don't know
the details about where the db control maintains db connection
information ( generated apt source ejb code perhaps with jdbc api calls
?? ), but in the past to maintain transaction management while
utilitzing a db control, the team I work on, has wrapped such a control
in a custom control that specifies a method level @TransactionAttribute
annotation.
i.e.,
the custom control interface:
--------------------
import org.apache.beehive.controls.api.bean.ControlInterface;
import com.bea.control.annotations.TransactionAttribute;
import com.bea.control.annotations.TransactionAttributeType;
@ControlInterface
public interface AdminControl {
@TransactionAttribute(value=TransactionAttributeType.REQUIRES_NEW,
rollbackOnCheckedException=true)
public int foobar(String arg1, String arg2) throws
AdminControlException;
public static class AdminControlException extends Exception {
private static final long serialVersionUID = 1L;
public AdminControlException(String message, Throwable cause) {
super(message, cause);
}
}
}
-------------------
The implementation
-------------------
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlImplementation;
import ...DashBoardJDBCControl;
@ControlImplementation
public class AdminControlImpl implements AdminControl, Serializable {
private static final long serialVersionUID = 1L;
@Control
private DashBoardJDBCControl _dashBoardJDBCControl;
public int foobar(String arg1, String arg2)
throws AdminControlException {
if ( isNullOrEmpty(arg1) ) {
return 0;
}
if ( isNullOrEmpty(arg2)) {
return 0;
}
if (arg1.equals(arg2)) {
return 0;
}
try {
// some db control calls here like:
/*
long arg1long= _dashBoardJDBCControl.dbFoobar (arg2);
long [] results = _dashBoardJDBCControl.dbFoobar2(arg1);
*/
// ...
/*
_dashBoardJDBCControl.someInsertFunctionPerhaps ( someArgs
);
Return someArgs.size();
*/
} catch (SQLException e) {
// logging
}
}
}
-----------
Here we see the custom controls interface specifying the transaction
management. The implementation, doesn't have to worry about it.
Thanks,
Jason.
-----Original Message-----
From: sahuly [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 16, 2007 6:41 AM
To: [email protected]
Subject: Connection and transaction in JDBC Control
hi ,
where the connection is established and released in the JDBC
Control...if
anyone have idea please reply....tell me some idea to maintain
transactoin
in JDBC Control
thanks in advance
regards,
sahuly.
--
View this message in context:
http://www.nabble.com/Connection-and-transaction-in-JDBC-Control-tf30209
70.html#a8390257
Sent from the Beehive - User mailing list archive at Nabble.com.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.