From: Gavin K. <Gav...@ex...> - 2002-12-16 22:32:31
|
You havn't really given enough info here (the problem certainly does *not* occur with "any settings in hibernate.properties"), but I will assume that you are using a Datasource (since otherwise Hibernate would set autocommit to false by itself). So the trick is to set up your JBoss datasource to return connections with autocommit false. This is certainly doable since most people have no=20 problems using Hibernate with JBoss, but I'm not sure of the details since I'm a WebSphere user myself. =20 These kind of questions should really be directed to the user forum, where there will be other JBoss users who can assist you. =20 Gavin -----Original Message----- From: vy...@qu... [mailto:vy...@qu...]=20 Sent: Monday, 16 December 2002 9:30 PM To: hib...@li... Subject: [Hibernate] Postgres/JBoss/Hibernate problem =09 =09 =20 I am using JBoss 3.2.0-beta-2, Postgres 7.2 and JDK 1.3.1 as=20 well as hibernate 1.2.=20 I am having difficulty committing any changes that I make because I get=20 error message saying: "java.sql.SQLException: You cannot commit with autocommit set!"=20 =09 bit of code:=20 =09 [java]=20 Context ctx =3D new InitialContext();=20 SessionFactory sessions =3D (SessionFactory)ctx.lookup("java:/HibernateFactory");=20 Session sess =3D sessions.openSession();=20 =09 Vertex v =3D new Vertex();=20 v.setName( "SomeName" );=20 sess.save(v);=20 =09 sess.close();=20 [/java]=20 =09 This problem occurs with any settings in hibernate.properties=20 =09 What needs for correct work without exeption.=20 =09 Regards, AAP =20 ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |