From: BESSON-DEBLON,
Pierre \(S. H. TECH\) <PIE...@ai...> - 2009-12-04 15:45:03
|
Hi, We have a problem with our sequoia : we have 2 controllers, the JDBC URL looks like that jdbc jdbc:sequoia://cont1,cont2/db. If we have cont1 down and cont2 with a deactivated backend, the requests fail even when cont2 backend is reactivated. Digging in the source code, the following code seems suspicious : ControllerPingSender.run() : : when 1 of the controller is down and the other have a backend disabled -----Message d'origine----- De : Emmanuel Cecchet [mailto:ma...@fr...] Envoyé : 18 November 2009 18:46 À : seq...@li... Cc : Sequoia general mailing list Objet : Re: [Sequoiadb-discuss] [Sequoia] about sequoia procedure call Hi, The sequoia mailing list has moved to seq...@li... Hi everyone, presently I encounter a problem about how to call procedures through sequoia virtual database console. Suppose a backend has a procedure in the form 'proc(IN id integer not null,IN name char(32) not null, IN score float with null)'. And I tried executing the procedure like this: {call proc(101,'student',80.0)} But such statement will raise exceptions from backend database which says errors like "invalid procedure call syntax". So I debugged the source code only to find the exceptions occurs from AbstractLoadBalancer.java, in function AbstractLoadBalancer::setupCallableStatement(), statement "cs = c.prepareCall(backend.transformQuery(proc)); ". If I executed like this: {call proc(?,?,?)} The above exception will disappear but no parameters in the procedure was assigned any value. So is this a bug in source code ? Or if not, how can I call the procedure correctly? If you use a CallableStatement, you are suppose to call a stored procedure this way: CallableStatement cs = connection.prepareCall({call proc(?,?,?)}); cs.setInt(1, 101); cs.setString(2, "student"); cs.setFloat(3, 80.0); cs.executeQuery() or cs.executeUpdate() depending on the result returned. Check for CallableStatement examples in the JDBC documentation. Thanks for your interest in Sequoia. Emmanuel -- Emmanuel Cecchet FTO @ Frog Thinker Open Source Development & Consulting -- Web: http://www.frogthinker.org email: ma...@fr... Skype: emmanuel_cecchet This mail has originated outside your organization, either from an external partner or the Global Internet. Keep this in mind if you answer this message. The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Airbus immediately and delete this e-mail. Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately. All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free. |