[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
How to persist Quartz jobs using Spring+Hibernate+c3p0?  XML
Forum Index -> Quartz
Author Message
kjayapau

neo

Joined: 07/19/2011 23:22:41
Messages: 9
Offline

Does anybody know how to persist Quartz jobs using Hibernate with c3p0 connection pool?

I managed to get Quartz persist it's jobs with a simple DriverManagerDataSource. However, I would like to use the ComboPooledDataSource provided by c3p0.

Because hibernate is used, the quartz tables assumably need to be mapped in hibernate configs (?).

Thanks in advance.

Regards,
karthikeyan
light5

ophanim
[Avatar]
Joined: 01/14/2011 20:32:56
Messages: 554
Offline

Quartz does not use Hibernate! It has it's own data access layer. You would have to setup your DB schema on your own. See the Quartz distribution for DDL files.

In Quartz 2.x, it is default to c3p0 conn pooling, while in Quartz 1.x, it's default to apache commons-dbcp. You can change all these with "org.quartz.dataSource.NAME.connectionProvider.class" property. See http://quartz-scheduler.org/docs/configuration/ConfigDataSources.html.

Zemian Deng
---------------
Looking for a web UI to manage Quartz?
Try http://code.google.com/p/myschedule
[WWW]
kjayapau

neo

Joined: 07/19/2011 23:22:41
Messages: 9
Offline

Thanks "light5".

Is there any way to override default data access layer with hibernate layer? i.e. using Hibernate Session object to insert/update/delete quartz's job or jobDetail tables?
light5

ophanim
[Avatar]
Joined: 01/14/2011 20:32:56
Messages: 554
Offline

You can certainly try to implements your own "org.quartz.spi.JobStore" interface using Hibernate.

Think about what you are trying to achive first though. You are attempting to write your own store layer that's already provided by working Quartz. Sure quartz is not using Hibernate, but it does what it ultimately what is asked to do: persist data into database. Quartz simply use JDBC layer without the fancy ORM layer. I suppose some advantage of using Hibernate is that you will have much more flexibility in defininig your schema and what to store in DB as objects/mapping as well.

Good luck and come back to share how your effort will go! :)

Zemian Deng
---------------
Looking for a web UI to manage Quartz?
Try http://code.google.com/p/myschedule
[WWW]
rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1491
Offline

Hi ,

Is the issue resolved ? Please let us know if more information is required.

Rakesh Joshi
Senior Consultant
Terracotta.
 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team