orm.PersistentException: Failed to create ThreadBaseSessionController

Hello,

In DBVA, after update my db and code, I got an orm.PersistentException with message Failed to create ThreadBaseSessionController??

Here the full exception report:
orm.PersistentException: Failed to create ThreadBaseSessionController
at orm.util.ThreadBaseSessionController.(ThreadBaseSessionController.java:29)
at orm.PersistentManager.(PersistentManager.java:62)
at org.mypackage.MyProjectPersistentManager.(MyProjectPersistentManager.java:21)
at org.mypackage.MyProjectPersistentManager.instance(MyProjectPersistentManager.java:30)
at org.mypackage.Sample.main(Sample.java:460)

Dear Antoine,

Thank you for your information, we will try to find out the cause of the problem.

Regards,

Antony.

Dear Antoine,

From the trace we cannot find out the cause of the problem, do you mind sending me your project, or any sample project that we can repeat the problem? My email address is antony@visual-paradigm.com

Regards,

Antony.

I have the same issue.

In my persistentmanager class, EmsPersistenManager, the static variables are:
private static final String PROJECT_NAME = “Ems”;
private static PersistentManager _instance = null;
private static SessionType _sessionType = SessionType.THREAD_BASE;
private static JDBCConnectionSetting _connectionSetting = null;

Are they supposed to be null?

Any lead to the initial posting?

What could be the possible cause of this exception?

Please advise.

Cheers,
Simon

Dear Simon,

Can you send me the complete stack trace on your problem? or if possible, could you send me the vp.log file? You can locate the log file in the %VP Suite%/bin directory.
Thanks in advance!

Best regards,
Rain

Dear Simon,

Our engineers discover that the PK and FK definition was not matched in your model. This could be the reason why the generated codes not work. Please modify your model and regenerate the persistent code and try again. If you have any further questions, please feel free to contact me again.

Best regards,
Rain

hi i have the same problem. A failed to create ThreadBaseSessionController Exception in my stack trace says it’s caused by a property-ref not found. If you can help i’d realliy apreciatte.

thnx.
Kyroz

this is my stack trace:

orm.PersistentException: Failed to create ThreadBaseSessionController
at orm.util.ThreadBaseSessionController.(ThreadBaseSessionController.java:29)
at orm.PersistentManager.(PersistentManager.java:66)
at cl.sinaptica.model.Modelling2PersistentManager.(Modelling2PersistentManager.java:21)
at cl.sinaptica.model.Modelling2PersistentManager.instance(Modelling2PersistentManager.java:31)
at Sample.dispose(Sample.java:102)
at Sample.main(Sample.java:116)
Caused by: org.hibernate.MappingException: property-ref not found: PerfilIdPerfil in class: cl.sinaptica.model.Usuario
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:887)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1049)
at orm.util.ORMSessionFactory.(ORMSessionFactory.java:17)
at orm.util.ThreadBaseSessionController.(ThreadBaseSessionController.java:26)

I have the same problem mentioned above regarding the ThreadBaseSessionController with missing hibernate mappings/ “property-ref not found”. My exception stack is identical with respect to my project’s classes.

This is a shame as I was very pleased with DB Architect v3.0 (Windows) so far in an evaluation license. The software seemed to work fine for the first project I generated, and I was actively pleading the case to purchase this tool with my management. However, with my second test project failing, I doubt I will purchase.

–Adam

Dear Adam,

Thank you for your post.

Are you using the latest release? As I know our engineers have recently fixed a bug which is likely to be the cause of the problem you encountered. If you are not using the latest release, I would recommend you advance to the latest one and try again.

If the problem still persists, could you please send me your project file and the steps for reproducing the same problem ? Thank you.

Finally, if you require an extension to your evaluation period, please let me know.

Best Regards,
Jick

I also get something similar:

org.orm.PersistentException: Failed to create ThreadBaseSessionController
at org.orm.util.ThreadBaseSessionController.(ThreadBaseSessionController.java:29)
at org.orm.PersistentManager.(PersistentManager.java:90)
at be.tradelec.autopermit.UntitledPersistentManager.(UntitledPersistentManager.java:30)
at be.tradelec.autopermit.UntitledPersistentManager.instance(UntitledPersistentManager.java:40)
at ormsamples.CreateUntitledData.main(CreateUntitledData.java:145)
Caused by: org.hibernate.MappingException: Foreign key (FKBB979BF4612C5064:address [street_idStreet])) must have same number of columns as the referenced primary key (street [idStreet,name])
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:90)
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:73)
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1263)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1170)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at org.orm.util.ORMSessionFactory.(ORMSessionFactory.java:17)
at org.orm.util.ThreadBaseSessionController.(ThreadBaseSessionController.java:26)
… 4 more

I can’t really understand why this error occurs because I’m not even trying to save something in the address table.
Perhaps if I could enable something to see the generated sql statement I can try to find the source of the problem.

Any help appreciated!

Hi Dr. Drane,

Thanks for your post. Would you mind to attach your project file for investigation? Thanks in advance!

If you do not want the project to be accessed by public, please send to lilian@visual-paradigm.com

BTW, did you receive this error when you generate database from ERD?

Best regards,
Lilian Wong

When I try to reverse the DB via annotations + DAO with interface I get a different error:

org.hibernate.AnnotationException: referencedColumnNames(idlanguage) of be.tradelec.autopermit.Address_has_languagePK.id.language_idlanguage referencing be.tradelec.autopermit.Language not mapped to a single property
at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:167)
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:63)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:477)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:297)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at be.tradelec.autopermit.UntitledPersistentManager.createConfiguration(UntitledPersistentManager.java:95)
at org.orm.PersistentManager.(PersistentManager.java:59)
at be.tradelec.autopermit.UntitledPersistentManager.(UntitledPersistentManager.java:31)
at be.tradelec.autopermit.UntitledPersistentManager.instance(UntitledPersistentManager.java:105)
at ormsamples.CreateUntitledData.main(CreateUntitledData.java:184)

I will mail you my mysql database together with my VP-UML project + the generated code.

Thanks in advance,

Jochen

Hi Jochen,

Thanks for the details and I received your email with workspace, project file and generated code already. I’ve forwarded the issue to our engineers to investigate, and I’ll come back to you once there is any feedback.

Best regards,
Lilian Wong

Hi Jochen,

Our engineers checked that the problem is due to 2 problems.
1st problem
More than 10 relationships on your ERD has constraint error that FK table doesn’t have enough column to reference the source table (please see attached image as one of the problematic relationship). You need to fix the problem by specifying a column to reference the source table, or select Generate Default Column to let VP creates for you.

BTW, may I know how did you create these entities so that there are constraint error on relationships? Did you create entities manually, reverse database, or some other ways?

2nd problem
There is a bug in Annotation in Hibernate, which will be fixed in next release (VP Suite 4.1). I’ve sent you an email with the release candidate of VP Suite 4.1 so you can have a try to confirm it’s fixed.
If you cannot find my email, please try to find it from your trash and junk box.

Feel free to let me know if there is any further inquiry.

Best regards,
Lilian Wong

no_column_to_reference_source_table.png

Orm.PersistentException: Failed to create ThreadBaseSessionController
at Orm.Util.UserDefinedSessionController…ctor(Configuration cfg)
at Orm.PersistentManager…ctor(DotNetConnectionSetting connectionSetting, SessionType sessionType)

I think I have this issue, however, if it’s related to 1st problem, then how could I know what exact relations are have problems?

I checked all my my FKs and did not found any of these problems you mention. What could it be then?

Hello denismo,

Can you send me your project file to have a look? You can send to support-team@visual-paradigm.com in case you don’t want to attach it in here. But please make sure you include the URL of this post in your email. Thanks.

Best regards,
Rain

I have this error in one particular situation. When I have built the code and the database automatically, I want to use the code in a project that has different package name with the one defined in the process of making the code through the “Hibernate>Wizard” menu. But when I rename the imported package (in the new project), the error comes up. It happens because reference to the old package name is not only in class definition. There also also references in strings in “*.hbm.xml” files. When I refactor all of the references, including the ones in strings, the error does not happen anymore.

Hi,

The hbm files reference the package, class, property names, so if you change these name after generate, you have to manually update the corresponding hbm files. It is recommended to change in VP and re-generate. You can also generate mapping as annotation without the hbm files.