Eclipse Jobs and Hibernate [message #324357] |
Wed, 23 January 2008 14:39 |
Piotr Górny Messages: 72 Registered: July 2009 |
Member |
|
|
Hi,
I've got strange problem with Hibernate used as database persistence system
when invoking a few database queries in separate jobs.
My screnario looks this way:
I have a class called LogonManager (extends Job) which calls about 10
job steps using:
protected IStatus run(final IProgressMonitor monitor)
{
final IWorkbench workbench = PlatformUI.getWorkbench();
final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
final Shell shell = window != null ? window.getShell() : null;
final IRunnableWithProgress runnableWithProgress = new
IRunnableWithProgress()
{
public void run(final IProgressMonitor monitor) throws
InvocationTargetException, InterruptedException
{
try
{
monitor.beginTask("my job", , IProgressMonitor.UNKNOWN);
for (ILogonStep step : steps)
{
monitor.subTask(step.getLogonStepName());
step.execLogonStep(new SubProgressMonitor(monitor, 1));
}
}
finally
{
monitor.done();
}
}
}
}
Each step does some database querying by opeing its own transaction,
sending query,
getting results and doing something with them.
Unfortunately lately my application hungs up at random steps, and I have
discovered
that it stop when calling:
session.createQuery(...)
Does anyone have any idea what problem can be here?
Is it connected to Eclipse's jobs?
I'll ask the same question on hibernate forum, but I wander if this
isn't connected
with jobs architecture of Eclipse - that's why I've asked here too.
--
Piotr
|
|
|
Re: Eclipse Jobs and Hibernate [message #324397 is a reply to message #324357] |
Wed, 23 January 2008 21:39 |
Snjezana Peco Messages: 789 Registered: July 2009 |
Senior Member |
|
|
This problem isn't related to Eclipse's jobs.
Do you commit/rollback the transactions that you open in your steps?
Snjeza
Piotr Górny wrote:
> Hi,
> I've got strange problem with Hibernate used as database persistence system
> when invoking a few database queries in separate jobs.
>
> My screnario looks this way:
> I have a class called LogonManager (extends Job) which calls about 10
> job steps using:
> protected IStatus run(final IProgressMonitor monitor)
> {
> final IWorkbench workbench = PlatformUI.getWorkbench();
> final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
> final Shell shell = window != null ? window.getShell() : null;
>
> final IRunnableWithProgress runnableWithProgress = new
> IRunnableWithProgress()
> {
> public void run(final IProgressMonitor monitor) throws
> InvocationTargetException, InterruptedException
> {
> try
> {
> monitor.beginTask("my job", , IProgressMonitor.UNKNOWN);
> for (ILogonStep step : steps)
> {
> monitor.subTask(step.getLogonStepName());
> step.execLogonStep(new SubProgressMonitor(monitor, 1));
> }
> }
> finally
> {
> monitor.done();
> }
> }
> }
> }
>
> Each step does some database querying by opeing its own transaction,
> sending query,
> getting results and doing something with them.
>
> Unfortunately lately my application hungs up at random steps, and I have
> discovered
> that it stop when calling:
> session.createQuery(...)
>
> Does anyone have any idea what problem can be here?
> Is it connected to Eclipse's jobs?
>
> I'll ask the same question on hibernate forum, but I wander if this
> isn't connected
> with jobs architecture of Eclipse - that's why I've asked here too.
>
> --
> Piotr
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03324 seconds