No Active Transaction Error / Unable to insert
The “No Active Transaction Error” can occur when the Address Book Server is not able to store the data in the database. When this happens please consult the server log. Towards the end of the log Accessing Log files file you should see the error message similar to the one shown here:
2008-May-23 14:00:34 [Log4JLogger - WARN] SQL Error: 90005, SQLState: 90005 2008-May-23 14:00:34 [Log4JLogger - ERROR] Value too long for column COMPANYNAME [90005-65] 2008-May-23 14:00:34 [Log4JLogger - WARN] SQL Error: 90005, SQLState: 90005 2008-May-23 14:00:34 [Log4JLogger - ERROR] Value too long for column COMPANYNAME [90005-65] 2008-May-23 14:00:34 [Log4JLogger - ERROR] Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: could not insert: [com.j2anywhere.addressbookserver.entities.Contact] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
In this case the error was encountered on the COMPANYNAME column of the Contact table. The error indicated that the value submitted was too long for the column. By default the columns are 255 characters long, which should cater for most cases. However you can modify the size of the column to suit your needs using SQL.
For example ALTER TABLE CONTACTS ALTER COLUMN COMPANYNAME VARCHAR(1024); would increase the size of the column to 1024 characters. After changing the database you should try to synchronise again on the client. If you are using the default H2 database engine you find details on accessing the database directly here : Accessing H2 Database
After increasing the size allocation you can identify the record using the following SQL statement
SELECT LENGTH(COMPANYNAME),COMPANYNAME FROM CONTACTS WHERE COMPANYNAME IS NOT NULL ORDER BY 1 DESC
From the June 09 versions onwards you might also need to increase the space allocation for the record deletions table using
ALTER TABLE RECORDDELETION ALTER COLUMN BASICVALUE VARCHAR(1024);
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)