You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Puneet Gupta (JIRA)" <ji...@apache.org> on 2016/09/17 07:52:20 UTC
[jira] [Comment Edited] (LENS-1308) User config loader database
calls not inserting entries
[ https://issues.apache.org/jira/browse/LENS-1308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15498498#comment-15498498 ]
Puneet Gupta edited comment on LENS-1308 at 9/17/16 7:51 AM:
-------------------------------------------------------------
Lets keep auto commit false by default and have explicit commit (like we are doing in org.apache.lens.server.query.LensServerDAO#insertFinishedQuery). Or else we need to follow a different model where we can keep autocommit true by default and turn it off wherever we need transactions (may be very few places).
{noformat}
conn.setAutoCommit(false)
try
{
…some logic...
insert one row ..
insert another row..
conn.commit()
} Exception { }
{noformat}
between 1st and 2nd row if there is an error we should not commit
Note sure if below are working in current state without any explicit commits.
1. org.apache.lens.server.query.LensServerDAO#createFinishedQueriesTable and
2. org.apache.lens.server.query.LensServerDAO#dropFinishedQueriesTable
was (Author: puneet884):
Lets keep auto commit false by default and have explicit commit (like we are doing in org.apache.lens.server.query.LensServerDAO#insertFinishedQuery). Or else we need to follow a different model where we can keep autocommit true by default and turn it off wherever we need transactions (may be very few places).
{noformat}
conn.setAutoCommit(false)
try
{
…some logic...
insert one row ..
insert another row..
conn.setAutoCommit(true)
} Exception { }
{noformat}
between 1st and 2nd row if there is an error we should not commit
Note sure if below are working in current state without any explicit commits.
1. org.apache.lens.server.query.LensServerDAO#createFinishedQueriesTable and
2. org.apache.lens.server.query.LensServerDAO#dropFinishedQueriesTable
> User config loader database calls not inserting entries
> -------------------------------------------------------
>
> Key: LENS-1308
> URL: https://issues.apache.org/jira/browse/LENS-1308
> Project: Apache Lens
> Issue Type: Bug
> Affects Versions: 2.3
> Reporter: Rajat Khandelwal
> Assignee: Rajat Khandelwal
> Fix For: 2.7
>
> Attachments: LENS-1308.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)