KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sellwin > server > SellwinSessionBean


1 package sellwin.server;
2
3 import java.sql.*;
4 import java.rmi.*;
5 import java.util.*;
6 import javax.ejb.*;
7 import javax.sql.*;
8 import javax.naming.*;
9
10 import sellwin.domain.*;
11
12 // SellWin http://sourceforge.net/projects/sellwincrm
13
//Contact support@open-app.com for commercial help with SellWin
14
//This software is provided "AS IS", without a warranty of any kind.
15

16 /**
17  * this class is a stateful session bean that delegates client
18  * calls to the BizServices class which actually implements the
19  * business services we are providing to the outside world (clients)
20  * when they are configured to communicate via EJB technology
21  */

22 public class SellwinSessionBean extends BizServices implements SessionBean {
23
24     private SessionContext ctx;
25     private Context environment;
26
27     private DataSource ds;
28
29     //some state
30

31     public SellwinSessionBean() {
32         super();
33     }
34
35     /**
36      * set the session context
37      *
38      * @param ctx SessionContext for session
39      */

40     public void setSessionContext(SessionContext ctx) {
41         this.ctx = ctx;
42     }
43
44     /**
45      * this method is required by the EJB SessionBean interface
46      * and does nothing special for this implementation
47      */

48     public void ejbActivate() {
49         System.out.println("ejbActivate called");
50     }
51
52     /**
53      * this method is required by the EJB SessionBean interface
54      * and does nothing special for this implementation
55      */

56     public void ejbPassivate() {
57         System.out.println("ejbPassivate called");
58     }
59
60     /**
61      * this method is required by the EJB SessionBean interface
62      * and does nothing special for this implementation
63      */

64     public void ejbRemove() {
65         System.out.println("ejbRemove called");
66     }
67
68     /**
69      * this method corresponds to the create method in the
70      * SellwinSessionHome interface. When the client calls
71      * SellwinSessionHome.create(), the container allocates an
72      * instance of the session bean and calls this method, ejbCreate()
73      *
74      * @exception javax.ejb.CreateException
75      * if there is a problem creating the bean
76      */

77     public void ejbCreate() throws CreateException {
78
79         try {
80             InitialContext ic = new InitialContext();
81             System.out.println("got the initial context");
82             System.out.println("about to get datasource");
83             //weblogic uses the next JNDI name for the lookup
84
//ds = (DataSource)ic.lookup("sellwinPool");
85
//jboss uses the next JNDI name for the lookup
86
//ds = (DataSource)ic.lookup("java:/OracleDB");
87
ds = (DataSource)ic.lookup("java:/SellwinDS");
88             System.out.println("got handle to jdbc data source");
89         } catch (NamingException e) {
90             e.printStackTrace();
91             throw new CreateException("could not find initial context");
92         }
93     }
94
95     /**
96      * get the weblogic initial context used for
97      * jndi lookups (i.e. jdbc datasource)
98      * @return the InitialContext
99      */

100     public javax.naming.InitialContext JavaDoc getContext()
101         throws javax.naming.NamingException JavaDoc {
102     
103         Hashtable ht = new Hashtable();
104         ht.put(Context.INITIAL_CONTEXT_FACTORY,
105             "weblogic.jndi.WLInitialContextFactor");
106         ht.put(Context.PROVIDER_URL,
107             "t3://localhost:7001");
108         javax.naming.InitialContext JavaDoc ctx = new InitialContext(ht);
109
110         return ctx;
111
112     }
113
114     /**
115      * get the datasource used to get jdbc connections
116      * by doing a jndi lookup via the EJB container's
117      * context
118      * @param ctx the InitialContext to do the lookup with
119      * @return the DataSource found
120      */

121     public javax.sql.DataSource JavaDoc getDataSource(InitialContext ctx)
122         throws javax.naming.NamingException JavaDoc {
123
124         javax.sql.DataSource JavaDoc ds = (javax.sql.DataSource JavaDoc)
125             ctx.lookup("sellwinPool");
126         return ds;
127     }
128
129     /**
130      * @see sellwin.server.BizServices updateLead method
131      */

132     public void updateLead(long campPK, Lead l)
133         throws RemoteException, AngError {
134
135         Connection con=null;
136
137         try {
138             con = ds.getConnection();
139             con.setAutoCommit(false);
140             leadDB.setConnection(con);
141             super.updateLead(campPK, l);
142         } catch (SQLException s) {
143             throw new AngError(s.getMessage());
144         } catch (AngError a) {
145             throw a;
146         } catch (RemoteException r) {
147             throw r;
148         } finally {
149             try {
150                 con.close();
151             } catch (SQLException x) {
152                 x.printStackTrace();
153             }
154         }
155     }
156
157     /**
158      * @see sellwin.server.BizServices getOpportunityIndex method
159      */

160     public ArrayList getOpportunityIndex(SalesPerson u)
161         throws RemoteException, AngError {
162
163         Connection con=null;
164
165         try {
166             con = ds.getConnection();
167             con.setAutoCommit(false);
168             oppDB.setConnection(con);
169             return super.getOpportunityIndex(u);
170         } catch (SQLException s) {
171             throw new AngError(s.getMessage());
172         } catch (AngError a) {
173             throw a;
174         } catch (RemoteException r) {
175             throw r;
176         } finally {
177             try {
178                 con.close();
179             } catch (SQLException x) {
180                 x.printStackTrace();
181             }
182         }
183     }
184
185     /**
186      * @see sellwin.server.BizServices getProductMatrix method
187      */

188     public ArrayList getProductMatrix()
189         throws RemoteException, AngError {
190
191         Connection con=null;
192
193         try {
194             con = ds.getConnection();
195             con.setAutoCommit(false);
196             productDB.setConnection(con);
197             return super.getProductMatrix();
198         } catch (SQLException s) {
199             throw new AngError(s.getMessage());
200         } catch (AngError a) {
201             throw a;
202         } catch (RemoteException r) {
203             throw r;
204         } finally {
205             try {
206                 con.close();
207             } catch (SQLException x) {
208                 x.printStackTrace();
209             }
210         }
211     }
212
213     /**
214      * @see sellwin.server.BizServices getProductsForLine method
215      */

216     public ArrayList getProductsForLine(String JavaDoc group, String JavaDoc line)
217         throws RemoteException, AngError {
218
219         Connection con=null;
220
221         try {
222             con = ds.getConnection();
223             con.setAutoCommit(false);
224             productDB.setConnection(con);
225             return super.getProductsForLine(group, line);
226         } catch (SQLException s) {
227             throw new AngError(s.getMessage());
228         } catch (AngError a) {
229             throw a;
230         } catch (RemoteException r) {
231             throw r;
232         } finally {
233             try {
234                 con.close();
235             } catch (SQLException x) {
236                 x.printStackTrace();
237             }
238         }
239     }
240
241     /**
242      * @see sellwin.server.BizServices getProduct method
243      */

244     public Product getProduct(String JavaDoc group, String JavaDoc line, String JavaDoc name)
245         throws RemoteException, AngError {
246
247         Connection con=null;
248
249         try {
250             con = ds.getConnection();
251             con.setAutoCommit(false);
252             productDB.setConnection(con);
253             return super.getProduct(group, line, name);
254         } catch (SQLException s) {
255             throw new AngError(s.getMessage());
256         } catch (AngError a) {
257             throw a;
258         } catch (RemoteException r) {
259             throw r;
260         } finally {
261             try {
262                 con.close();
263             } catch (SQLException x) {
264                 x.printStackTrace();
265             }
266         }
267     }
268
269     /**
270      * @see sellwin.server.BizServices addForecast method
271      */

272     public long addForecast(long opportunityPK, Forecast forecast)
273         throws RemoteException, AngError {
274
275         Connection con=null;
276
277         try {
278             con = ds.getConnection();
279             con.setAutoCommit(false);
280             forecastDB.setConnection(con);
281             return super.addForecast(opportunityPK, forecast);
282         } catch (SQLException s) {
283             throw new AngError(s.getMessage());
284         } catch (AngError a) {
285             throw a;
286         } catch (RemoteException r) {
287             throw r;
288         } finally {
289             try {
290                 con.close();
291             } catch (SQLException x) {
292                 x.printStackTrace();
293             }
294         }
295     }
296
297     /**
298      * @see sellwin.server.BizServices updateForecast method
299      */

300     public void updateForecast(long oppPK, Forecast forecast)
301         throws RemoteException, AngError {
302
303         Connection con=null;
304
305         try {
306             con = ds.getConnection();
307             con.setAutoCommit(false);
308             forecastDB.setConnection(con);
309             super.updateForecast(oppPK, forecast);
310         } catch (SQLException s) {
311             throw new AngError(s.getMessage());
312         } catch (AngError a) {
313             throw a;
314         } catch (RemoteException r) {
315             throw r;
316         } finally {
317             try {
318                 con.close();
319             } catch (SQLException x) {
320                 x.printStackTrace();
321             }
322         }
323     }
324
325     /**
326      * @see sellwin.server.BizServices deleteForecast method
327      */

328     public void deleteForecast(long oppPK, long forecastPK)
329         throws RemoteException, AngError {
330
331         Connection con=null;
332
333         try {
334             con = ds.getConnection();
335             con.setAutoCommit(false);
336             forecastDB.setConnection(con);
337             super.deleteForecast(oppPK, forecastPK);
338         } catch (SQLException s) {
339             throw new AngError(s.getMessage());
340         } catch (AngError a) {
341             throw a;
342         } catch (RemoteException r) {
343             throw r;
344         } finally {
345             try {
346                 con.close();
347             } catch (SQLException x) {
348                 x.printStackTrace();
349             }
350         }
351     }
352
353     /**
354      * @see sellwin.server.BizServices addOrder method
355      */

356     public long addOrder(long oppPK, Order order)
357         throws RemoteException, AngError {
358
359         Connection con=null;
360
361         try {
362             con = ds.getConnection();
363             con.setAutoCommit(false);
364             orderDB.setConnection(con);
365             return super.addOrder(oppPK, order);
366         } catch (SQLException s) {
367             throw new AngError(s.getMessage());
368         } catch (AngError a) {
369             throw a;
370         } catch (RemoteException r) {
371             throw r;
372         } finally {
373             try {
374                 con.close();
375             } catch (SQLException x) {
376                 x.printStackTrace();
377             }
378         }
379     }
380
381     /**
382      * @see sellwin.server.BizServices updateOrder method
383      */

384     public void updateOrder(long oppPK, Order order)
385         throws RemoteException, AngError {
386
387         Connection con=null;
388
389         try {
390             con = ds.getConnection();
391             con.setAutoCommit(false);
392             orderDB.setConnection(con);
393             super.updateOrder(oppPK, order);
394         } catch (SQLException s) {
395             throw new AngError(s.getMessage());
396         } catch (AngError a) {
397             throw a;
398         } catch (RemoteException r) {
399             throw r;
400         } finally {
401             try {
402                 con.close();
403             } catch (SQLException x) {
404                 x.printStackTrace();
405             }
406         }
407     }
408
409     /**
410      * @see sellwin.server.BizServices addQuote method
411      */

412     public long addQuote(long oppPK, Quote quote)
413         throws RemoteException, AngError {
414
415         Connection con=null;
416
417         try {
418             con = ds.getConnection();
419             con.setAutoCommit(false);
420             quoteDB.setConnection(con);
421             return super.addQuote(oppPK, quote);
422         } catch (SQLException s) {
423             throw new AngError(s.getMessage());
424         } catch (AngError a) {
425             throw a;
426         } catch (RemoteException r) {
427             throw r;
428         } finally {
429             try {
430                 con.close();
431             } catch (SQLException x) {
432                 x.printStackTrace();
433             }
434         }
435     }
436
437     /**
438      * @see sellwin.server.BizServices updateQuote method
439      */

440     public void updateQuote(long oppPK, Quote quote)
441         throws RemoteException, AngError {
442
443         Connection con=null;
444
445         try {
446             con = ds.getConnection();
447             con.setAutoCommit(false);
448             quoteDB.setConnection(con);
449             super.updateQuote(oppPK, quote);
450         } catch (SQLException s) {
451             throw new AngError(s.getMessage());
452         } catch (AngError a) {
453             throw a;
454         } catch (RemoteException r) {
455             throw r;
456         } finally {
457             try {
458                 con.close();
459             } catch (SQLException x) {
460                 x.printStackTrace();
461             }
462         }
463     }
464
465     /**
466      * @see sellwin.server.BizServices deleteQuote method
467      */

468     public void deleteQuote(long oppPK, long quotePK)
469         throws RemoteException, AngError {
470
471         Connection con=null;
472
473         try {
474             con = ds.getConnection();
475             con.setAutoCommit(false);
476             quoteDB.setConnection(con);
477             super.deleteQuote(oppPK, quotePK);
478         } catch (SQLException s) {
479             throw new AngError(s.getMessage());
480         } catch (AngError a) {
481             throw a;
482         } catch (RemoteException r) {
483             throw r;
484         } finally {
485             try {
486                 con.close();
487             } catch (SQLException x) {
488                 x.printStackTrace();
489             }
490         }
491     }
492
493     /**
494      * @see sellwin.server.BizServices addQuoteLine method
495      */

496     public long addQuoteLine(long oppPK, long quotePK, QuoteLine quoteLine)
497         throws RemoteException, AngError {
498
499         Connection con=null;
500
501         try {
502             con = ds.getConnection();
503             con.setAutoCommit(false);
504             quoteLineDB.setConnection(con);
505             return super.addQuoteLine(oppPK, quotePK, quoteLine);
506         } catch (SQLException s) {
507             throw new AngError(s.getMessage());
508         } catch (AngError a) {
509             throw a;
510         } catch (RemoteException r) {
511             throw r;
512         } finally {
513             try {
514                 con.close();
515             } catch (SQLException x) {
516                 x.printStackTrace();
517             }
518         }
519     }
520
521     /**
522      * @see sellwin.server.BizServices deleteQuoteLine method
523      */

524     public void deleteQuoteLine(long oppPK, long quotePK, long quoteLinePK)
525         throws RemoteException, AngError {
526
527         Connection con=null;
528
529         try {
530             con = ds.getConnection();
531             con.setAutoCommit(false);
532             quoteLineDB.setConnection(con);
533             super.deleteQuoteLine(oppPK, quotePK, quoteLinePK);
534         } catch (SQLException s) {
535             throw new AngError(s.getMessage());
536         } catch (AngError a) {
537             throw a;
538         } catch (RemoteException r) {
539             throw r;
540         } finally {
541             try {
542                 con.close();
543             } catch (SQLException x) {
544                 x.printStackTrace();
545             }
546         }
547     }
548
549     /**
550      * @see sellwin.server.BizServices getAlarms method
551      */

552     public ArrayList getAlarms(long salesPersonPK)
553         throws RemoteException, AngError {
554
555         Connection con=null;
556
557         try {
558             con = ds.getConnection();
559             con.setAutoCommit(false);
560             activityDB.setConnection(con);
561             return super.getAlarms(salesPersonPK);
562         } catch (SQLException s) {
563             throw new AngError(s.getMessage());
564         } catch (AngError a) {
565             throw a;
566         } catch (RemoteException r) {
567             throw r;
568         } finally {
569             try {
570                 con.close();
571             } catch (SQLException x) {
572                 x.printStackTrace();
573             }
574         }
575     }
576
577     /**
578      * @see sellwin.server.BizServices addActivity method
579      */

580     public long addActivity(long opportunityPK, Activity activity)
581         throws RemoteException, AngError {
582
583         Connection con=null;
584
585         try {
586             con = ds.getConnection();
587             con.setAutoCommit(false);
588             activityDB.setConnection(con);
589             return super.addActivity(opportunityPK, activity);
590         } catch (SQLException s) {
591             throw new AngError(s.getMessage());
592         } catch (AngError a) {
593             throw a;
594         } catch (RemoteException r) {
595             throw r;
596         } finally {
597             try {
598                 con.close();
599             } catch (SQLException x) {
600                 x.printStackTrace();
601             }
602         }
603     }
604
605     /**
606      * @see sellwin.server.BizServices updateActivity method
607      */

608     public void updateActivity(long opportunityPK, Activity activity)
609         throws RemoteException, AngError {
610
611         Connection con=null;
612
613         try {
614             con = ds.getConnection();
615             con.setAutoCommit(false);
616             activityDB.setConnection(con);
617             super.updateActivity(opportunityPK, activity);
618         } catch (SQLException s) {
619             throw new AngError(s.getMessage());
620         } catch (AngError a) {
621             throw a;
622         } catch (RemoteException r) {
623             throw r;
624         } finally {
625             try {
626                 con.close();
627             } catch (SQLException x) {
628                 x.printStackTrace();
629             }
630         }
631     }
632
633     /**
634      * @see sellwin.server.BizServices deleteActivity method
635      */

636     public void deleteActivity(long opportunityPK, long activityPK)
637         throws RemoteException, AngError {
638
639         Connection con=null;
640
641         try {
642             con = ds.getConnection();
643             con.setAutoCommit(false);
644             activityDB.setConnection(con);
645             super.deleteActivity(opportunityPK, activityPK);
646         } catch (SQLException s) {
647             throw new AngError(s.getMessage());
648         } catch (AngError a) {
649             throw a;
650         } catch (RemoteException r) {
651             throw r;
652         } finally {
653             try {
654                 con.close();
655             } catch (SQLException x) {
656                 x.printStackTrace();
657             }
658         }
659     }
660
661     /**
662      * @see sellwin.server.BizServices getAllUserRoles method
663      */

664     public ArrayList getAllUserRoles(java.util.Date JavaDoc lastSyncDate)
665         throws RemoteException, AngError {
666
667         Connection con=null;
668
669         try {
670             con = ds.getConnection();
671             con.setAutoCommit(false);
672             userRoleDB.setConnection(con);
673             return super.getAllUserRoles(lastSyncDate);
674         } catch (SQLException s) {
675             throw new AngError(s.getMessage());
676         } catch (AngError a) {
677             throw a;
678         } catch (RemoteException r) {
679             throw r;
680         } finally {
681             try {
682                 con.close();
683             } catch (SQLException x) {
684                 x.printStackTrace();
685             }
686         }
687     }
688
689     /**
690      * @see sellwin.server.BizServices addUserRole method
691      */

692     public void addUserRole(UserRole userRole)
693         throws RemoteException, AngError {
694
695         Connection con=null;
696
697         try {
698             con = ds.getConnection();
699             con.setAutoCommit(false);
700             userRoleDB.setConnection(con);
701             super.addUserRole(userRole);
702         } catch (SQLException s) {
703             throw new AngError(s.getMessage());
704         } catch (AngError a) {
705             throw a;
706         } catch (RemoteException r) {
707             throw r;
708         } finally {
709             try {
710                 con.close();
711             } catch (SQLException x) {
712                 x.printStackTrace();
713             }
714         }
715     }
716
717     /**
718      * @see sellwin.server.BizServices deleteUserRole method
719      */

720     public void deleteUserRole(long pk)
721         throws RemoteException, AngError {
722
723         Connection con=null;
724
725         try {
726             con = ds.getConnection();
727             con.setAutoCommit(false);
728             userRoleDB.setConnection(con);
729             super.deleteUserRole(pk);
730         } catch (SQLException s) {
731             throw new AngError(s.getMessage());
732         } catch (AngError a) {
733             throw a;
734         } catch (RemoteException r) {
735             throw r;
736         } finally {
737             try {
738                 con.close();
739             } catch (SQLException x) {
740                 x.printStackTrace();
741             }
742         }
743     }
744
745     /**
746      * @see sellwin.server.BizServices updateUserRole method
747      */

748     public void updateUserRole(UserRole userRole)
749         throws RemoteException, AngError {
750
751         Connection con=null;
752
753         try {
754             con = ds.getConnection();
755             con.setAutoCommit(false);
756             userRoleDB.setConnection(con);
757             super.updateUserRole(userRole);
758         } catch (SQLException s) {
759             throw new AngError(s.getMessage());
760         } catch (AngError a) {
761             throw a;
762         } catch (RemoteException r) {
763             throw r;
764         } finally {
765             try {
766                 con.close();
767             } catch (SQLException x) {
768                 x.printStackTrace();
769             }
770         }
771     }
772
773     /**
774      * @see sellwin.server.BizServices getUserRole method
775      */

776     public UserRole getUserRole(String JavaDoc userRoleName)
777         throws RemoteException, AngError {
778
779         Connection con=null;
780
781         try {
782             con = ds.getConnection();
783             con.setAutoCommit(false);
784             userRoleDB.setConnection(con);
785             return super.getUserRole(userRoleName);
786         } catch (SQLException s) {
787             throw new AngError(s.getMessage());
788         } catch (AngError a) {
789             throw a;
790         } catch (RemoteException r) {
791             throw r;
792         } finally {
793             try {
794                 con.close();
795             } catch (SQLException x) {
796                 x.printStackTrace();
797             }
798         }
799     }
800
801     /**
802      * @see sellwin.server.BizServices logon method
803      */

804     public Login logon(String JavaDoc id, String JavaDoc psw)
805         throws RemoteException, AngError {
806
807         Connection con=null;
808
809         try {
810             System.out.println("logon called id=" + id + " psw=" + psw);
811             con = ds.getConnection();
812             con.setAutoCommit(false);
813             salesPersonDB.setConnection(con);
814             return super.logon(id, psw);
815         } catch (SQLException s) {
816             throw new AngError(s.getMessage());
817         } catch (AngError a) {
818             throw a;
819         } catch (RemoteException r) {
820             throw r;
821         } finally {
822             try {
823                 if (con != null) con.close();
824             } catch (SQLException x) {
825                 x.printStackTrace();
826             }
827         }
828     }
829
830     /**
831      * @see sellwin.server.BizServices deleteCustomer method
832      */

833     public void deleteCustomer(String JavaDoc customerName)
834         throws RemoteException, AngError {
835
836         Connection con=null;
837
838         try {
839             con = ds.getConnection();
840             con.setAutoCommit(false);
841             customerDB.setConnection(con);
842             super.deleteCustomer(customerName);
843         } catch (SQLException s) {
844             throw new AngError(s.getMessage());
845         } catch (AngError a) {
846             throw a;
847         } catch (RemoteException r) {
848             throw r;
849         } finally {
850             try {
851                 con.close();
852             } catch (SQLException x) {
853                 x.printStackTrace();
854             }
855         }
856     }
857
858     /**
859      * @see sellwin.server.BizServices deleteCustomer method
860      */

861     public void updateCustomer(Customer customer)
862         throws RemoteException, AngError {
863
864         Connection con=null;
865
866         try {
867             con = ds.getConnection();
868             con.setAutoCommit(false);
869             customerDB.setConnection(con);
870             super.updateCustomer(customer);
871         } catch (SQLException s) {
872             throw new AngError(s.getMessage());
873         } catch (AngError a) {
874             throw a;
875         } catch (RemoteException r) {
876             throw r;
877         } finally {
878             try {
879                 con.close();
880             } catch (SQLException x) {
881                 x.printStackTrace();
882             }
883         }
884     }
885
886     /**
887      * @see sellwin.server.BizServices addCustomer method
888      */

889     public long addCustomer(Customer customer)
890         throws RemoteException, AngError {
891
892         Connection con=null;
893
894         try {
895             con = ds.getConnection();
896             con.setAutoCommit(false);
897             customerDB.setConnection(con);
898             return super.addCustomer(customer);
899         } catch (SQLException s) {
900             throw new AngError(s.getMessage());
901         } catch (AngError a) {
902             throw a;
903         } catch (RemoteException r) {
904             throw r;
905         } finally {
906             try {
907                 con.close();
908             } catch (SQLException x) {
909                 x.printStackTrace();
910             }
911         }
912     }
913
914     /**
915      * @see sellwin.server.BizServices getCustomer method
916      */

917     public Customer getCustomer(String JavaDoc customerName)
918         throws RemoteException, AngError {
919
920         Connection con=null;
921
922         try {
923             con = ds.getConnection();
924             con.setAutoCommit(false);
925             customerDB.setConnection(con);
926             return super.getCustomer(customerName);
927         } catch (SQLException s) {
928             throw new AngError(s.getMessage());
929         } catch (AngError a) {
930             throw a;
931         } catch (RemoteException r) {
932             throw r;
933         } finally {
934             try {
935                 con.close();
936             } catch (SQLException x) {
937                 x.printStackTrace();
938             }
939         }
940     }
941
942     /**
943      * @see sellwin.server.BizServices getAllCustomerNames method
944      */

945     public Object JavaDoc[] getAllCustomerNames()
946         throws RemoteException, AngError {
947
948         Connection con=null;
949
950         try {
951             con = ds.getConnection();
952             con.setAutoCommit(false);
953             customerDB.setConnection(con);
954             return super.getAllCustomerNames();
955         } catch (SQLException s) {
956             throw new AngError(s.getMessage());
957         } catch (AngError a) {
958             throw a;
959         } catch (RemoteException r) {
960             throw r;
961         } finally {
962             try {
963                 con.close();
964             } catch (SQLException x) {
965                 x.printStackTrace();
966             }
967         }
968     }
969
970     /**
971      * @see sellwin.server.BizServices getCustomers method
972      */

973     public ArrayList getCustomers(java.util.Date JavaDoc lastSyncDate)
974         throws RemoteException, AngError {
975
976         Connection con=null;
977
978         try {
979             con = ds.getConnection();
980             con.setAutoCommit(false);
981             customerDB.setConnection(con);
982             return super.getCustomers(lastSyncDate);
983         } catch (SQLException s) {
984             throw new AngError(s.getMessage());
985         } catch (AngError a) {
986             throw a;
987         } catch (RemoteException r) {
988             throw r;
989         } finally {
990             try {
991                 con.close();
992             } catch (SQLException x) {
993                 x.printStackTrace();
994             }
995         }
996     }
997
998     /**
999      * @see sellwin.server.BizServices getStateTax method
1000     */

1001    public ArrayList getStateTax(java.util.Date JavaDoc lastSyncDate)
1002        throws RemoteException, AngError {
1003
1004        Connection con=null;
1005
1006        try {
1007            con = ds.getConnection();
1008            con.setAutoCommit(false);
1009            stateTaxDB.setConnection(con);
1010            return super.getStateTax(lastSyncDate);
1011        } catch (SQLException s) {
1012            throw new AngError(s.getMessage());
1013        } catch (AngError a) {
1014            throw a;
1015        } catch (RemoteException r) {
1016            throw r;
1017        } finally {
1018            try {
1019                con.close();
1020            } catch (SQLException x) {
1021                x.printStackTrace();
1022            }
1023        }
1024    }
1025
1026    /**
1027     * @see sellwin.server.BizServices addProduct method
1028     */

1029    public void addProduct(Product product)
1030        throws RemoteException, AngError {
1031
1032        Connection con=null;
1033
1034        try {
1035            con = ds.getConnection();
1036            con.setAutoCommit(false);
1037            productDB.setConnection(con);
1038            super.addProduct(product);
1039        } catch (SQLException s) {
1040            throw new AngError(s.getMessage());
1041        } catch (AngError a) {
1042            throw a;
1043        } catch (RemoteException r) {
1044            throw r;
1045        } finally {
1046            try {
1047                con.close();
1048            } catch (SQLException x) {
1049                x.printStackTrace();
1050            }
1051        }
1052    }
1053
1054    /**
1055     * @see sellwin.server.BizServices getProducts method
1056     */

1057    public ArrayList getProducts(java.util.Date JavaDoc afterDate)
1058        throws RemoteException, AngError {
1059
1060        Connection con=null;
1061
1062        try {
1063            con = ds.getConnection();
1064            con.setAutoCommit(false);
1065            productDB.setConnection(con);
1066            return super.getProducts(afterDate);
1067        } catch (SQLException s) {
1068            throw new AngError(s.getMessage());
1069        } catch (AngError a) {
1070            throw a;
1071        } catch (RemoteException r) {
1072            throw r;
1073        } finally {
1074            try {
1075                con.close();
1076            } catch (SQLException x) {
1077                x.printStackTrace();
1078            }
1079        }
1080    }
1081
1082    /**
1083     * @see sellwin.server.BizServices getOpportunityNames method
1084     */

1085    public ArrayList getOpportunityNames(SalesPerson salesPerson)
1086        throws RemoteException, AngError {
1087
1088        Connection con=null;
1089
1090        try {
1091            con = ds.getConnection();
1092            con.setAutoCommit(false);
1093            oppDB.setConnection(con);
1094            return super.getOpportunityNames(salesPerson);
1095        } catch (SQLException s) {
1096            throw new AngError(s.getMessage());
1097        } catch (AngError a) {
1098            throw a;
1099        } catch (RemoteException r) {
1100            throw r;
1101        } finally {
1102            try {
1103                con.close();
1104            } catch (SQLException x) {
1105                x.printStackTrace();
1106            }
1107        }
1108    }
1109
1110    /**
1111     * @see sellwin.server.BizServices getOpportunities method
1112     */

1113    public ArrayList getOpportunities(SalesPerson salesPerson, java.util.Date JavaDoc lastSyncDate)
1114        throws RemoteException, AngError {
1115
1116        Connection con=null;
1117
1118        try {
1119            con = ds.getConnection();
1120            con.setAutoCommit(false);
1121            oppDB.setConnection(con);
1122            return super.getOpportunities(salesPerson, lastSyncDate);
1123        } catch (SQLException s) {
1124            throw new AngError(s.getMessage());
1125        } catch (AngError a) {
1126            throw a;
1127        } catch (RemoteException r) {
1128            throw r;
1129        } finally {
1130            try {
1131                con.close();
1132            } catch (SQLException x) {
1133                x.printStackTrace();
1134            }
1135        }
1136    }
1137
1138    /**
1139     * @see sellwin.server.BizServices getOpportunity method
1140     */

1141    public Opportunity getOpportunity(long oppPK)
1142        throws RemoteException, AngError {
1143
1144        Connection con=null;
1145
1146        try {
1147            con = ds.getConnection();
1148            con.setAutoCommit(false);
1149            oppDB.setConnection(con);
1150            return super.getOpportunity(oppPK);
1151        } catch (SQLException s) {
1152            throw new AngError(s.getMessage());
1153        } catch (AngError a) {
1154            throw a;
1155        } catch (RemoteException r) {
1156            throw r;
1157        } finally {
1158            try {
1159                con.close();
1160            } catch (SQLException x) {
1161                x.printStackTrace();
1162            }
1163        }
1164    }
1165
1166    /**
1167     * @see sellwin.server.BizServices deleteOpportunity method
1168     */

1169    public void deleteOpportunity(long oppPK)
1170        throws RemoteException, AngError {
1171
1172        Connection con=null;
1173
1174        try {
1175            con = ds.getConnection();
1176            con.setAutoCommit(false);
1177            oppDB.setConnection(con);
1178            super.deleteOpportunity(oppPK);
1179        } catch (SQLException s) {
1180            throw new AngError(s.getMessage());
1181        } catch (AngError a) {
1182            throw a;
1183        } catch (RemoteException r) {
1184            throw r;
1185        } finally {
1186            try {
1187                con.close();
1188            } catch (SQLException x) {
1189                x.printStackTrace();
1190            }
1191        }
1192    }
1193
1194    /**
1195     * @see sellwin.server.BizServices addOpportunity method
1196     */

1197    public long addOpportunity(Opportunity opp)
1198        throws RemoteException, AngError {
1199
1200        Connection con=null;
1201
1202        try {
1203            con = ds.getConnection();
1204            con.setAutoCommit(false);
1205            oppDB.setConnection(con);
1206            return super.addOpportunity(opp);
1207        } catch (SQLException s) {
1208            throw new AngError(s.getMessage());
1209        } catch (AngError a) {
1210            throw a;
1211        } catch (RemoteException r) {
1212            throw r;
1213        } finally {
1214            try {
1215                con.close();
1216            } catch (SQLException x) {
1217                x.printStackTrace();
1218            }
1219        }
1220    }
1221
1222    /**
1223     * @see sellwin.server.BizServices updateOpportunity method
1224     */

1225    public void updateOpportunity(Opportunity opp)
1226        throws RemoteException, AngError {
1227
1228        Connection con=null;
1229
1230        try {
1231            con = ds.getConnection();
1232            con.setAutoCommit(false);
1233            oppDB.setConnection(con);
1234            super.updateOpportunity(opp);
1235        } catch (SQLException s) {
1236            throw new AngError(s.getMessage());
1237        } catch (AngError a) {
1238            throw a;
1239        } catch (RemoteException r) {
1240            throw r;
1241        } finally {
1242            try {
1243                con.close();
1244            } catch (SQLException x) {
1245                x.printStackTrace();
1246            }
1247        }
1248    }
1249
1250    /**
1251     * @see sellwin.server.BizServices deleteContact method
1252     */

1253    public void deleteContact(long oppPK, long contactPK)
1254        throws RemoteException, AngError {
1255
1256        Connection con=null;
1257
1258        try {
1259            con = ds.getConnection();
1260            con.setAutoCommit(false);
1261            contactDB.setConnection(con);
1262            super.deleteContact(oppPK, contactPK);
1263        } catch (SQLException s) {
1264            throw new AngError(s.getMessage());
1265        } catch (AngError a) {
1266            throw a;
1267        } catch (RemoteException r) {
1268            throw r;
1269        } finally {
1270            try {
1271                con.close();
1272            } catch (SQLException x) {
1273                x.printStackTrace();
1274            }
1275        }
1276    }
1277
1278    /**
1279     * @see sellwin.server.BizServices updateContact method
1280     */

1281    public void updateContact(long oppPK, Contact contact)
1282        throws RemoteException, AngError {
1283
1284        Connection con=null;
1285
1286        try {
1287            con = ds.getConnection();
1288            con.setAutoCommit(false);
1289            contactDB.setConnection(con);
1290            super.updateContact(oppPK, contact);
1291        } catch (SQLException s) {
1292            throw new AngError(s.getMessage());
1293        } catch (AngError a) {
1294            throw a;
1295        } catch (RemoteException r) {
1296            throw r;
1297        } finally {
1298            try {
1299                con.close();
1300            } catch (SQLException x) {
1301                x.printStackTrace();
1302            }
1303        }
1304    }
1305
1306    /**
1307     * @see sellwin.server.BizServices addContact method
1308     */

1309    public long addContact(long oppPK, Contact contact)
1310        throws RemoteException, AngError {
1311
1312        Connection con=null;
1313
1314        try {
1315            con = ds.getConnection();
1316            con.setAutoCommit(false);
1317            contactDB.setConnection(con);
1318            return super.addContact(oppPK, contact);
1319        } catch (SQLException s) {
1320            throw new AngError(s.getMessage());
1321        } catch (AngError a) {
1322            throw a;
1323        } catch (RemoteException r) {
1324            throw r;
1325        } finally {
1326            try {
1327                con.close();
1328            } catch (SQLException x) {
1329                x.printStackTrace();
1330            }
1331        }
1332    }
1333
1334    /**
1335     * @see sellwin.server.BizServices getSalesPersons method
1336     */

1337    public Object JavaDoc[] getSalesPersons(java.util.Date JavaDoc lastSyncDate)
1338        throws RemoteException, AngError {
1339
1340        Connection con=null;
1341
1342        try {
1343            con = ds.getConnection();
1344            con.setAutoCommit(false);
1345            salesPersonDB.setConnection(con);
1346            return super.getSalesPersons(lastSyncDate);
1347        } catch (SQLException s) {
1348            throw new AngError(s.getMessage());
1349        } catch (AngError a) {
1350            throw a;
1351        } catch (RemoteException r) {
1352            throw r;
1353        } finally {
1354            try {
1355                con.close();
1356            } catch (SQLException x) {
1357                x.printStackTrace();
1358            }
1359        }
1360    }
1361
1362    /**
1363     * @see sellwin.server.BizServices getSalesPerson method
1364     */

1365    public SalesPerson getSalesPerson(long pk)
1366        throws RemoteException, AngError {
1367
1368        Connection con=null;
1369
1370        try {
1371            con = ds.getConnection();
1372            con.setAutoCommit(false);
1373            salesPersonDB.setConnection(con);
1374            return super.getSalesPerson(pk);
1375        } catch (SQLException s) {
1376            throw new AngError(s.getMessage());
1377        } catch (AngError a) {
1378            throw a;
1379        } catch (RemoteException r) {
1380            throw r;
1381        } finally {
1382            try {
1383                con.close();
1384            } catch (SQLException x) {
1385                x.printStackTrace();
1386            }
1387        }
1388    }
1389
1390    /**
1391     * @see sellwin.server.BizServices updateSalesPerson method
1392     */

1393    public void updateSalesPerson(SalesPerson salesPerson)
1394        throws RemoteException, AngError {
1395
1396        Connection con=null;
1397
1398        try {
1399            con = ds.getConnection();
1400            con.setAutoCommit(false);
1401            salesPersonDB.setConnection(con);
1402            super.updateSalesPerson(salesPerson);
1403        } catch (SQLException s) {
1404            throw new AngError(s.getMessage());
1405        } catch (AngError a) {
1406            throw a;
1407        } catch (RemoteException r) {
1408            throw r;
1409        } finally {
1410            try {
1411                con.close();
1412            } catch (SQLException x) {
1413                x.printStackTrace();
1414            }
1415        }
1416    }
1417
1418    /**
1419     * @see sellwin.server.BizServices deleteSalesPerson method
1420     */

1421    public void deleteSalesPerson(SalesPerson person)
1422        throws RemoteException, AngError {
1423
1424        Connection con=null;
1425
1426        try {
1427            con = ds.getConnection();
1428            con.setAutoCommit(false);
1429            salesPersonDB.setConnection(con);
1430            super.deleteSalesPerson(person);
1431        } catch (SQLException s) {
1432            throw new AngError(s.getMessage());
1433        } catch (AngError a) {
1434            throw a;
1435        } catch (RemoteException r) {
1436            throw r;
1437        } finally {
1438            try {
1439                con.close();
1440            } catch (SQLException x) {
1441                x.printStackTrace();
1442            }
1443        }
1444    }
1445
1446    /**
1447     * @see sellwin.server.BizServices addSalesPerson method
1448     */

1449    public long addSalesPerson(SalesPerson salesPerson)
1450        throws RemoteException, AngError {
1451
1452        Connection con=null;
1453
1454        try {
1455            con = ds.getConnection();
1456            con.setAutoCommit(false);
1457            salesPersonDB.setConnection(con);
1458            return super.addSalesPerson(salesPerson);
1459        } catch (SQLException s) {
1460            throw new AngError(s.getMessage());
1461        } catch (AngError a) {
1462            throw a;
1463        } catch (RemoteException r) {
1464            throw r;
1465        } finally {
1466            try {
1467                con.close();
1468            } catch (SQLException x) {
1469                x.printStackTrace();
1470            }
1471        }
1472    }
1473
1474    /**
1475     * @see sellwin.server.BizServices getSalesPersonIDs method
1476     */

1477    public ArrayList getSalesPersonIDs()
1478        throws RemoteException, AngError {
1479
1480        Connection con=null;
1481
1482        try {
1483            con = ds.getConnection();
1484            con.setAutoCommit(false);
1485            salesPersonDB.setConnection(con);
1486            return super.getSalesPersonIDs();
1487        } catch (SQLException s) {
1488            throw new AngError(s.getMessage());
1489        } catch (AngError a) {
1490            throw a;
1491        } catch (RemoteException r) {
1492            throw r;
1493        } finally {
1494            try {
1495                con.close();
1496            } catch (SQLException x) {
1497                x.printStackTrace();
1498            }
1499        }
1500    }
1501
1502    /**
1503     * @see sellwin.server.BizServices getSalesPersonNames method
1504     */

1505    public ArrayList getSalesPersonNames()
1506        throws RemoteException, AngError {
1507
1508        Connection con=null;
1509
1510        try {
1511            con = ds.getConnection();
1512            con.setAutoCommit(false);
1513            salesPersonDB.setConnection(con);
1514            return super.getSalesPersonNames();
1515        } catch (SQLException s) {
1516            throw new AngError(s.getMessage());
1517        } catch (AngError a) {
1518            throw a;
1519        } catch (RemoteException r) {
1520            throw r;
1521        } finally {
1522            try {
1523                con.close();
1524            } catch (SQLException x) {
1525                x.printStackTrace();
1526            }
1527        }
1528    }
1529
1530    /**
1531     * @see sellwin.server.BizServices addUserToGroup method
1532     */

1533    public void addUserToGroup(long userPK, UserGroup group)
1534        throws RemoteException, AngError {
1535
1536        Connection con=null;
1537
1538        try {
1539            con = ds.getConnection();
1540            con.setAutoCommit(false);
1541            ugMemberDB.setConnection(con);
1542            super.addUserToGroup(userPK, group);
1543        } catch (SQLException s) {
1544            throw new AngError(s.getMessage());
1545        } catch (AngError a) {
1546            throw a;
1547        } catch (RemoteException r) {
1548            throw r;
1549        } finally {
1550            try {
1551                con.close();
1552            } catch (SQLException x) {
1553                x.printStackTrace();
1554            }
1555        }
1556    }
1557
1558    /**
1559     * @see sellwin.server.BizServices getUsersInGroup method
1560     */

1561    public Object JavaDoc[] getUsersInGroup(String JavaDoc groupName)
1562        throws RemoteException, AngError {
1563
1564        Connection con=null;
1565
1566        try {
1567            con = ds.getConnection();
1568            con.setAutoCommit(false);
1569            userGroupDB.setConnection(con);
1570            return super.getUsersInGroup(groupName);
1571        } catch (SQLException s) {
1572            throw new AngError(s.getMessage());
1573        } catch (AngError a) {
1574            throw a;
1575        } catch (RemoteException r) {
1576            throw r;
1577        } finally {
1578            try {
1579                con.close();
1580            } catch (SQLException x) {
1581                x.printStackTrace();
1582            }
1583        }
1584    }
1585
1586    /**
1587     * @see sellwin.server.BizServices getUserGroup method
1588     */

1589    public UserGroup getUserGroup(long pk)
1590        throws RemoteException, AngError {
1591
1592        Connection con=null;
1593
1594        try {
1595            con = ds.getConnection();
1596            con.setAutoCommit(false);
1597            userGroupDB.setConnection(con);
1598            return super.getUserGroup(pk);
1599        } catch (SQLException s) {
1600            throw new AngError(s.getMessage());
1601        } catch (AngError a) {
1602            throw a;
1603        } catch (RemoteException r) {
1604            throw r;
1605        } finally {
1606            try {
1607                con.close();
1608            } catch (SQLException x) {
1609                x.printStackTrace();
1610            }
1611        }
1612    }
1613
1614    /**
1615     * @see sellwin.server.BizServices getUserGroups method
1616     */

1617    public Object JavaDoc[] getUserGroups(java.util.Date JavaDoc lastSyncDate)
1618        throws RemoteException, AngError {
1619
1620        Connection con=null;
1621
1622        try {
1623            con = ds.getConnection();
1624            con.setAutoCommit(false);
1625            userGroupDB.setConnection(con);
1626            return super.getUserGroups(lastSyncDate);
1627        } catch (SQLException s) {
1628            throw new AngError(s.getMessage());
1629        } catch (AngError a) {
1630            throw a;
1631        } catch (RemoteException r) {
1632            throw r;
1633        } finally {
1634            try {
1635                con.close();
1636            } catch (SQLException x) {
1637                x.printStackTrace();
1638            }
1639        }
1640    }
1641
1642    /**
1643     * @see sellwin.server.BizServices addUserGroup method
1644     */

1645    public void addUserGroup(UserGroup group)
1646        throws RemoteException, AngError {
1647
1648        Connection con=null;
1649
1650        try {
1651            con = ds.getConnection();
1652            con.setAutoCommit(false);
1653            userGroupDB.setConnection(con);
1654            super.addUserGroup(group);
1655        } catch (SQLException s) {
1656            throw new AngError(s.getMessage());
1657        } catch (AngError a) {
1658            throw a;
1659        } catch (RemoteException r) {
1660            throw r;
1661        } finally {
1662            try {
1663                con.close();
1664            } catch (SQLException x) {
1665                x.printStackTrace();
1666            }
1667        }
1668    }
1669
1670    /**
1671     * @see sellwin.server.BizServices deleteUserGroup method
1672     */

1673    public void deleteUserGroup(String JavaDoc groupName)
1674        throws RemoteException, AngError {
1675
1676        Connection con=null;
1677
1678        try {
1679            con = ds.getConnection();
1680            con.setAutoCommit(false);
1681            userGroupDB.setConnection(con);
1682            super.deleteUserGroup(groupName);
1683        } catch (SQLException s) {
1684            throw new AngError(s.getMessage());
1685        } catch (AngError a) {
1686            throw a;
1687        } catch (RemoteException r) {
1688            throw r;
1689        } finally {
1690            try {
1691                con.close();
1692            } catch (SQLException x) {
1693                x.printStackTrace();
1694            }
1695        }
1696    }
1697
1698    /**
1699     * @see sellwin.server.BizServices deleteUserInGroup method
1700     */

1701    public void deleteUserInGroup(UserGroup group, long userPK)
1702        throws RemoteException, AngError {
1703
1704        Connection con=null;
1705
1706        try {
1707            con = ds.getConnection();
1708            con.setAutoCommit(false);
1709            ugMemberDB.setConnection(con);
1710            super.deleteUserInGroup(group, userPK);
1711        } catch (SQLException s) {
1712            throw new AngError(s.getMessage());
1713        } catch (AngError a) {
1714            throw a;
1715        } catch (RemoteException r) {
1716            throw r;
1717        } finally {
1718            try {
1719                con.close();
1720            } catch (SQLException x) {
1721                x.printStackTrace();
1722            }
1723        }
1724    }
1725
1726    /**
1727     * @see sellwin.server.BizServices getGroupsForUser method
1728     */

1729    public ArrayList getGroupsForUser(long userPK)
1730        throws RemoteException, AngError {
1731
1732        Connection con=null;
1733
1734        try {
1735            con = ds.getConnection();
1736            con.setAutoCommit(false);
1737            ugMemberDB.setConnection(con);
1738            return super.getGroupsForUser(userPK);
1739        } catch (SQLException s) {
1740            throw new AngError(s.getMessage());
1741        } catch (AngError a) {
1742            throw a;
1743        } catch (RemoteException r) {
1744            throw r;
1745        } finally {
1746            try {
1747                con.close();
1748            } catch (SQLException x) {
1749                x.printStackTrace();
1750            }
1751        }
1752    }
1753
1754    /**
1755     * @see sellwin.server.BizServices getCampaigns method
1756     */

1757    public ArrayList getCampaigns(java.util.Date JavaDoc lastSyncDate)
1758        throws RemoteException, AngError {
1759
1760        Connection con=null;
1761
1762        try {
1763            con = ds.getConnection();
1764            con.setAutoCommit(false);
1765            campaignDB.setConnection(con);
1766            return super.getCampaigns(lastSyncDate);
1767        } catch (SQLException s) {
1768            throw new AngError(s.getMessage());
1769        } catch (AngError a) {
1770            throw a;
1771        } catch (RemoteException r) {
1772            throw r;
1773        } finally {
1774            try {
1775                con.close();
1776            } catch (SQLException x) {
1777                x.printStackTrace();
1778            }
1779        }
1780    }
1781
1782    /**
1783     * @see sellwin.server.BizServices getCampaignLeads method
1784     */

1785    public ArrayList getCampaignLeads(java.util.Date JavaDoc syncDate)
1786        throws RemoteException, AngError {
1787
1788        Connection con=null;
1789
1790        try {
1791            con = ds.getConnection();
1792            con.setAutoCommit(false);
1793            leadDB.setConnection(con);
1794            return super.getCampaignLeads(syncDate);
1795        } catch (SQLException s) {
1796            throw new AngError(s.getMessage());
1797        } catch (AngError a) {
1798            throw a;
1799        } catch (RemoteException r) {
1800            throw r;
1801        } finally {
1802            try {
1803                con.close();
1804            } catch (SQLException x) {
1805                x.printStackTrace();
1806            }
1807        }
1808    }
1809
1810    /**
1811     * @see sellwin.server.BizServices getCampaignLeads method
1812     */

1813    public ArrayList getCampaignLeads(long campaignPK)
1814        throws RemoteException, AngError {
1815
1816        Connection con=null;
1817
1818        try {
1819            con = ds.getConnection();
1820            con.setAutoCommit(false);
1821            leadDB.setConnection(con);
1822            return super.getCampaignLeads(campaignPK);
1823        } catch (SQLException s) {
1824            throw new AngError(s.getMessage());
1825        } catch (AngError a) {
1826            throw a;
1827        } catch (RemoteException r) {
1828            throw r;
1829        } finally {
1830            try {
1831                con.close();
1832            } catch (SQLException x) {
1833                x.printStackTrace();
1834            }
1835        }
1836    }
1837
1838    /**
1839     * @see sellwin.server.BizServices uploadDeletes method
1840     */

1841    public void uploadDeletes(ArrayList deletes)
1842        throws RemoteException, AngError {
1843
1844        Connection con=null;
1845
1846        try {
1847            con = ds.getConnection();
1848            con.setAutoCommit(false);
1849            activityDB.setConnection(con);
1850            forecastDB.setConnection(con);
1851            quoteDB.setConnection(con);
1852            quoteLineDB.setConnection(con);
1853            contactDB.setConnection(con);
1854            oppDB.setConnection(con);
1855            super.uploadDeletes(deletes);
1856        } catch (SQLException s) {
1857            throw new AngError(s.getMessage());
1858        } catch (AngError a) {
1859            throw a;
1860        } catch (RemoteException r) {
1861            throw r;
1862        } finally {
1863            try {
1864                con.close();
1865            } catch (SQLException x) {
1866                x.printStackTrace();
1867            }
1868        }
1869    }
1870
1871    /**
1872     * @see sellwin.server.BizServices addCustomerInventory method
1873     */

1874    public long addCustomerInventory(CustomerInventory ci)
1875        throws RemoteException, AngError {
1876
1877        Connection con=null;
1878
1879        try {
1880            con = ds.getConnection();
1881            con.setAutoCommit(false);
1882            custInventoryDB.setConnection(con);
1883            return super.addCustomerInventory(ci);
1884        } catch (SQLException s) {
1885            throw new AngError(s.getMessage());
1886        } catch (AngError a) {
1887            throw a;
1888        } catch (RemoteException r) {
1889            throw r;
1890        } finally {
1891            try {
1892                con.close();
1893            } catch (SQLException x) {
1894                x.printStackTrace();
1895            }
1896        }
1897    }
1898
1899    /**
1900     * @see sellwin.server.BizServices deleteCustomerInventory method
1901     */

1902    public void deleteCustomerInventory(CustomerInventory ci)
1903        throws RemoteException, AngError {
1904
1905        Connection con=null;
1906
1907        try {
1908            con = ds.getConnection();
1909            con.setAutoCommit(false);
1910            custInventoryDB.setConnection(con);
1911            super.deleteCustomerInventory(ci);
1912        } catch (SQLException s) {
1913            throw new AngError(s.getMessage());
1914        } catch (AngError a) {
1915            throw a;
1916        } catch (RemoteException r) {
1917            throw r;
1918        } finally {
1919            try {
1920                con.close();
1921            } catch (SQLException x) {
1922                x.printStackTrace();
1923            }
1924        }
1925    }
1926
1927    /**
1928     * @see sellwin.server.BizServices getCustomerInventory method
1929     */

1930    public ArrayList getCustomerInventory(long customerPK)
1931        throws RemoteException, AngError {
1932
1933        Connection con=null;
1934
1935        try {
1936            con = ds.getConnection();
1937            con.setAutoCommit(false);
1938            custInventoryDB.setConnection(con);
1939            return super.getCustomerInventory(customerPK);
1940        } catch (SQLException s) {
1941            throw new AngError(s.getMessage());
1942        } catch (AngError a) {
1943            throw a;
1944        } catch (RemoteException r) {
1945            throw r;
1946        } finally {
1947            try {
1948                con.close();
1949            } catch (SQLException x) {
1950                x.printStackTrace();
1951            }
1952        }
1953    }
1954
1955    /**
1956     * get all the UserGroupMembers
1957     * @param lastSyncDate a user's last sync date or null, used to
1958     * limit the query
1959     * @return an ArrayList of UserGroupMember objects
1960     */

1961    public final ArrayList getGroupMembers(java.util.Date JavaDoc lastSyncDate)
1962        throws RemoteException, AngError {
1963
1964        Connection con=null;
1965        
1966        try {
1967            con = ds.getConnection();
1968            con.setAutoCommit(false);
1969            ugMemberDB.setConnection(con);
1970            return super.getGroupMembers(lastSyncDate);
1971        } catch (SQLException e) {
1972            e.printStackTrace();
1973            throw new AngError(e.getMessage());
1974        } finally {
1975            try {
1976                con.close();
1977            } catch (SQLException x) {
1978                x.printStackTrace();
1979            }
1980        }
1981    }
1982
1983}
1984
Popular Tags