RE: Connection Manager Question

2003-10-13 Thread ron . gallagher
Oscar --

The serviceConnectionManager method has been a part of the PersistenceBroker
interface since rev 1.14, 2002/12/24.  Is there any chance you have an old
copy of the OJB classes in your classpath?

Ron Gallagher
Atlanta, GA
[EMAIL PROTECTED]


-Original Message-
From: Oscar Quinteros [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 1:53 AM
To: [EMAIL PROTECTED]
Subject: Connection Manager Question


Hi, I am a new user from the Republic Argentina
I have tried to obtain an object Connection the following way:

PersistenceBroker broker = null;
broker = PersistenceBrokerFactory.defaultPersistenceBroker(); 
Connection con = broker.serviceConnectionManager().getConnection(); 

But the compiler gives Java he tells me that the Method 
serviceConnectionManager doesn't exist in the interface 
org.apache.ojb.broker.PersistenceBroker
I am using the version 1.0.rc4, and in the same one the documentation 
says that the method exists.

Here is the stack trace:
cannot resolve symbol
[javac]symbol  : method serviceConnectionManager  ()
[javac]location: interface org.apache.ojb.broker.PersistenceBroker
[javac]Connection con = broker.serviceConnectionManager().getConnection
();

Thank you for the Attention
Oscar Eduardo Quinteros
---








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Connection Manager Question

2003-09-15 Thread Armin Waibel
Hi,

never do con.close().
Normally this is done by OJB. When not
running in a PB-tx (or managed tx), then
it is allowed to call
ConnectionManager.releaseConnection()
if you want to close the connecion 'by hand'.
Else connection was closed on
PB.abortTransaction
PB.commitTransaction
PB.close

regards,
Armin

- Original Message -
From: Graham Lounder [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 15, 2003 7:32 PM
Subject: Connection Manager Question


 If I get a connection from the connection pool, do I have to close the
 connection?  Or will the broker.close() statement handle this?  I keep
 getting validation query failures when I add the conn.close()
statement.

 PersistenceBroker broker = null;
 try {
 broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
 Connection conn =
 broker.serviceConnectionManager().getConnection();
 CallableStatement cs = conn.prepareCall(sql);
 cs.execute();
 cs.close();
 conn.close();
 } catch(SQLException sqle) {
 log.error(SQLException:  + sqle.toString(), sqle);
 throw new DBException(SQLException, sqle);
 } catch(Exception e) {
 log.error(Exception:  + e.toString());
 throw new DBException(Exception, e);
 } finally {
 broker.close();
 }

 Cheers,
 Graham



 Graham Lounder - Java Developer
 CARIS Spatial Components Division
 [EMAIL PROTECTED]
 Phone:  (506) 458-8533
 Fax:(506) 459-3849


 NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME
 AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]